llvm-project/clang/lib
Douglas Gregor fe31481f68 Introduce a new AST node describing reference binding to temporaries.
MaterializeTemporaryExpr captures a reference binding to a temporary
value, making explicit that the temporary value (a prvalue) needs to
be materialized into memory so that its address can be used. The
intended AST invariant here is that a reference will always bind to a
glvalue, and MaterializeTemporaryExpr will be used to convert prvalues
into glvalues for that binding to happen. For example, given

  const int& r = 1.0;

The initializer of "r" will be a MaterializeTemporaryExpr whose
subexpression is an implicit conversion from the double literal "1.0"
to an integer value. 

IR generation benefits most from this new node, since it was
previously guessing (badly) when to materialize temporaries for the
purposes of reference binding. There are likely more refactoring and
cleanups we could perform there, but the introduction of
MaterializeTemporaryExpr fixes PR9565, a case where IR generation
would effectively bind a const reference directly to a bitfield in a
struct. Addresses <rdar://problem/9552231>.

llvm-svn: 133521
2011-06-21 17:03:29 +00:00
..
ARCMigrate [arcmt] Always add '__bridge' cast when 'self' is cast to a C pointer. rdar://9644061 2011-06-20 23:39:20 +00:00
AST Introduce a new AST node describing reference binding to temporaries. 2011-06-21 17:03:29 +00:00
Analysis Introduce a new AST node describing reference binding to temporaries. 2011-06-21 17:03:29 +00:00
Basic Make more use of llvm::StringRef in various APIs. In particular, don't 2011-06-21 15:13:30 +00:00
CodeGen Introduce a new AST node describing reference binding to temporaries. 2011-06-21 17:03:29 +00:00
Driver Fix typo. From Damjan Marion. 2011-06-21 08:45:08 +00:00
Frontend Make more use of llvm::StringRef in various APIs. In particular, don't 2011-06-21 15:13:30 +00:00
FrontendTool [arcmt] Remove '-arcmt-modify-in-memory', it turned out less useful than we hoped it would be. 2011-06-17 23:49:31 +00:00
Headers Define va_copy when in C++0x mode; C++0x picked it up from C99. 2011-06-20 15:03:22 +00:00
Index Modify some deleted function methods to better reflect reality: 2011-05-06 20:44:56 +00:00
Lex Make more use of llvm::StringRef in various APIs. In particular, don't 2011-06-21 15:13:30 +00:00
Parse Handle decltype keyword in Parser::isDeclarationSpecifier. 2011-06-19 08:02:06 +00:00
Rewrite Make more use of llvm::StringRef in various APIs. In particular, don't 2011-06-21 15:13:30 +00:00
Sema Introduce a new AST node describing reference binding to temporaries. 2011-06-21 17:03:29 +00:00
Serialization Introduce a new AST node describing reference binding to temporaries. 2011-06-21 17:03:29 +00:00
StaticAnalyzer Introduce a new AST node describing reference binding to temporaries. 2011-06-21 17:03:29 +00:00
CMakeLists.txt The ARC Migration Tool. All the credit goes to Argyrios and Fariborz 2011-06-15 23:25:17 +00:00
Makefile The ARC Migration Tool. All the credit goes to Argyrios and Fariborz 2011-06-15 23:25:17 +00:00