[cfe-commits] r91036 - /cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
Anders Carlsson
andersca at mac.com
Wed Dec 9 17:58:34 PST 2009
Author: andersca
Date: Wed Dec 9 19:58:33 2009
New Revision: 91036
URL: http://llvm.org/viewvc/llvm-project?rev=91036&view=rev
Log:
Actually store the pointer into the global variable, spotted by Eli.
Modified:
cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
Modified: cfe/trunk/lib/CodeGen/CGDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDeclCXX.cpp?rev=91036&r1=91035&r2=91036&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDeclCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDeclCXX.cpp Wed Dec 9 19:58:33 2009
@@ -193,10 +193,13 @@
EmitBlock(InitBlock);
if (D.getType()->isReferenceType()) {
+ QualType T = D.getType();
// We don't want to pass true for IsInitializer here, because a static
// reference to a temporary does not extend its lifetime.
- EmitReferenceBindingToExpr(D.getInit(), D.getType(),
- /*IsInitializer=*/false);
+ RValue RV = EmitReferenceBindingToExpr(D.getInit(), T,
+ /*IsInitializer=*/false);
+ EmitStoreOfScalar(RV.getScalarVal(), GV, /*Volatile=*/false, T);
+
} else
EmitDeclInit(*this, D, GV);
More information about the cfe-commits
mailing list