hanchenye-llvm-project/clang/tools
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
..
arcmt-test tools/arcmt-test: Don't attempt to link redundant libclang (clang-c). 2011-06-18 08:52:27 +00:00
c-index-test Remove ARCMigrate from more builds that it isn't needed in now that the 2011-06-16 23:53:28 +00:00
driver The ARC Migration Tool. All the credit goes to Argyrios and Fariborz 2011-06-15 23:25:17 +00:00
libclang Introduce a new AST node describing reference binding to temporaries. 2011-06-21 17:03:29 +00:00
scan-build The ARC Migration Tool. All the credit goes to Argyrios and Fariborz 2011-06-15 23:25:17 +00:00
scan-view Fix call to send_error() in scan-view. An int error code is expected but a string was being sent. Patch by Andrew Price! 2011-02-21 19:26:48 +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