summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-18 05:02:21 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-18 05:02:21 +0000
commite1314a64b803bfffe98bd43f9131e512fd7191dd (patch)
treee64925d088af17ee9710a4afc3054b565d130e8c /clang/lib/Sema/Sema.h
parent7a2dab882669e2b86a110bb38046149f1a5013d8 (diff)
downloadbcm5719-llvm-e1314a64b803bfffe98bd43f9131e512fd7191dd.tar.gz
bcm5719-llvm-e1314a64b803bfffe98bd43f9131e512fd7191dd.zip
Switch the initialization required by return statements over to the
new InitializationSequence. This fixes some bugs (e.g., PR5808), changed some diagnostics, and caused more churn than expected. What's new: - InitializationSequence now has a "C conversion sequence" category and step kind, which falls back to - Changed the diagnostics for returns to always have the result type of the function first and the type of the expression second. CheckSingleAssignmentConstraints to peform checking in C. - Improved ASTs for initialization of return values. The ASTs now capture all of the temporaries we need to create, but intentionally do not bind the tempoary that is actually returned, so that it won't get destroyed twice. - Make sure to perform an (elidable!) copy of the class object that is returned from a class. - Fix copy elision in CodeGen to properly see through the subexpressions that occur with elidable copies. - Give "new" its own entity kind; as with return values and thrown objects, we don't bind the expression so we don't call a destructor for it. Note that, with this patch, I've broken returning move-only types in C++0x. We'll fix it later, when we tackle NRVO. llvm-svn: 91669
Diffstat (limited to 'clang/lib/Sema/Sema.h')
-rw-r--r--clang/lib/Sema/Sema.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 3d03dfd8cee..9d40a13786b 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -935,6 +935,9 @@ public:
bool PerformCopyInitialization(Expr *&From, QualType ToType,
AssignmentAction Action, bool Elidable = false);
+ OwningExprResult PerformCopyInitialization(const InitializedEntity &Entity,
+ SourceLocation EqualLoc,
+ OwningExprResult Init);
ImplicitConversionSequence
TryObjectArgumentInitialization(QualType FromType, CXXMethodDecl *Method,
CXXRecordDecl *ActingContext);
OpenPOWER on IntegriCloud