[cfe-commits] r72103 - in /cfe/trunk/lib/CodeGen: CGExprAgg.cpp CGExprScalar.cpp
Anders Carlsson
andersca at mac.com
Mon May 18 21:48:36 PDT 2009
Author: andersca
Date: Mon May 18 23:48:36 2009
New Revision: 72103
URL: http://llvm.org/viewvc/llvm-project?rev=72103&view=rev
Log:
Have AggExprEmitter::VisitCXXConstructExpr make new variables if necessary. Stub out VisitCXXExprWithTemporaries.
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/lib/CodeGen/CGExprScalar.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=72103&r1=72102&r2=72103&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Mon May 18 23:48:36 2009
@@ -99,6 +99,8 @@
Visit(DAE->getExpr());
}
void VisitCXXConstructExpr(const CXXConstructExpr *E);
+ void VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E);
+
void VisitVAArgExpr(VAArgExpr *E);
void EmitInitializationToLValue(Expr *E, LValue Address);
@@ -295,9 +297,22 @@
void
AggExprEmitter::VisitCXXConstructExpr(const CXXConstructExpr *E) {
- assert(DestPtr && "Must have a dest to emit into!");
+ llvm::Value *V = DestPtr;
+
+ if (!V) {
+ assert(isa<CXXTempVarDecl>(E->getVarDecl()) &&
+ "Must have a temp var decl when there's no destination!");
+
+ V = CGF.CreateTempAlloca(CGF.ConvertType(E->getVarDecl()->getType()),
+ "tmpvar");
+ }
- CGF.EmitCXXConstructExpr(DestPtr, E);
+ CGF.EmitCXXConstructExpr(V, E);
+}
+
+void AggExprEmitter::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
+ // FIXME: Do something with the temporaries!
+ Visit(E->getSubExpr());
}
void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) {
Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=72103&r1=72102&r2=72103&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Mon May 18 23:48:36 2009
@@ -269,6 +269,11 @@
return CGF.LoadCXXThis();
}
+ Value *VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
+ // FIXME: Do something with the temporaries!
+ return Visit(E->getSubExpr());
+ }
+
// Binary Operators.
Value *EmitMul(const BinOpInfo &Ops) {
if (CGF.getContext().getLangOptions().OverflowChecking
More information about the cfe-commits
mailing list