[cfe-commits] r137574 - in /cfe/trunk: lib/CodeGen/CGExprScalar.cpp test/CodeGenCXX/reference-cast.cpp
Eli Friedman
eli.friedman at gmail.com
Sat Aug 13 21:50:35 PDT 2011
Author: efriedma
Date: Sat Aug 13 23:50:34 2011
New Revision: 137574
URL: http://llvm.org/viewvc/llvm-project?rev=137574&view=rev
Log:
Fix r137086 to actually work properly in general. PR10650.
Modified:
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
cfe/trunk/test/CodeGenCXX/reference-cast.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=137574&r1=137573&r2=137574&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Sat Aug 13 23:50:34 2011
@@ -344,8 +344,7 @@
// C++
Value *VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *E) {
- RValue RV = CGF.EmitLoadOfLValue(CGF.EmitLValue(E->GetTemporaryExpr()));
- return RV.getScalarVal();
+ return EmitLoadOfLValue(E);
}
Value *VisitCXXDefaultArgExpr(CXXDefaultArgExpr *DAE) {
Modified: cfe/trunk/test/CodeGenCXX/reference-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/reference-cast.cpp?rev=137574&r1=137573&r2=137574&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/reference-cast.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/reference-cast.cpp Sat Aug 13 23:50:34 2011
@@ -181,3 +181,14 @@
// CHECK-NEXT: ret i32 [[VVAL_I]]
return static_cast<const unsigned &>(v);
}
+
+namespace PR10650 {
+ struct Helper {
+ unsigned long long id();
+ };
+ unsigned long long test(Helper *obj) {
+ return static_cast<const unsigned long long&>(obj->id());
+ }
+ // CHECK: define i64 @_ZN7PR106504testEPNS_6HelperE
+ // CHECK: store i64
+}
More information about the cfe-commits
mailing list