[cfe-commits] r70785 - in /cfe/trunk/lib/CodeGen: CGCXX.cpp CGExpr.cpp CGExprAgg.cpp CodeGenFunction.h
Anders Carlsson
andersca at mac.com
Sun May 3 10:47:16 PDT 2009
Author: andersca
Date: Sun May 3 12:47:16 2009
New Revision: 70785
URL: http://llvm.org/viewvc/llvm-project?rev=70785&view=rev
Log:
Make codegen for constructors work again.
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=70785&r1=70784&r2=70785&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Sun May 3 12:47:16 2009
@@ -139,21 +139,9 @@
CGM.GetAddrOfCXXConstructor(D, Type), Args, D);
}
-LValue
-CodeGenFunction::EmitCXXTemporaryObjectExprLValue(
- const CXXTemporaryObjectExpr *E) {
- // Allocate the destination.
- llvm::Value *Dest = CreateTempAlloca(ConvertType(E->getType()), "tmp");
-
- EmitCXXTemporaryObjectExpr(Dest, E);
-
- return LValue::MakeAddr(Dest, E->getType().getCVRQualifiers(),
- getContext().getObjCGCAttrKind(E->getType()));
-}
-
void
-CodeGenFunction::EmitCXXTemporaryObjectExpr(llvm::Value *Dest,
- const CXXTemporaryObjectExpr *E) {
+CodeGenFunction::EmitCXXConstructExpr(llvm::Value *Dest,
+ const CXXConstructExpr *E) {
assert(Dest && "Must have a destination!");
const CXXRecordDecl *RD =
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=70785&r1=70784&r2=70785&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun May 3 12:47:16 2009
@@ -193,8 +193,6 @@
case Expr::CXXReinterpretCastExprClass:
case Expr::CXXConstCastExprClass:
return EmitCastLValue(cast<CastExpr>(E));
- case Expr::CXXTemporaryObjectExprClass:
- return EmitCXXTemporaryObjectExprLValue(cast<CXXTemporaryObjectExpr>(E));
}
}
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=70785&r1=70784&r2=70785&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Sun May 3 12:47:16 2009
@@ -98,7 +98,7 @@
void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *DAE) {
Visit(DAE->getExpr());
}
- void VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *E);
+ void VisitCXXConstructExpr(const CXXConstructExpr *E);
void VisitVAArgExpr(VAArgExpr *E);
void EmitInitializationToLValue(Expr *E, LValue Address);
@@ -294,15 +294,10 @@
}
void
-AggExprEmitter::VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *E) {
- llvm::Value *This = 0;
+AggExprEmitter::VisitCXXConstructExpr(const CXXConstructExpr *E) {
+ assert(DestPtr && "Must have a dest to emit into!");
- if (DestPtr)
- This = DestPtr;
- else
- This = CGF.CreateTempAlloca(CGF.ConvertType(E->getType()), "tmp");
-
- CGF.EmitCXXTemporaryObjectExpr(This, E);
+ CGF.EmitCXXConstructExpr(DestPtr, E);
}
void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) {
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=70785&r1=70784&r2=70785&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Sun May 3 12:47:16 2009
@@ -643,7 +643,6 @@
LValue EmitBlockDeclRefLValue(const BlockDeclRefExpr *E);
LValue EmitCXXConditionDeclLValue(const CXXConditionDeclExpr *E);
- LValue EmitCXXTemporaryObjectExprLValue(const CXXTemporaryObjectExpr *E);
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E);
LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E);
@@ -756,8 +755,7 @@
void GenerateStaticCXXBlockVarDeclInit(const VarDecl &D,
llvm::GlobalVariable *GV);
- void EmitCXXTemporaryObjectExpr(llvm::Value *Dest,
- const CXXTemporaryObjectExpr *E);
+ void EmitCXXConstructExpr(llvm::Value *Dest, const CXXConstructExpr *E);
//===--------------------------------------------------------------------===//
// Internal Helpers
More information about the cfe-commits
mailing list