Have AggExprEmitter::VisitCXXConstructExpr make new variables if necessary. Stub out VisitCXXExprWithTemporaries.

llvm-svn: 72103
This commit is contained in:
Anders Carlsson 2009-05-19 04:48:36 +00:00
parent 549c5bd824
commit c82b86dfaa
2 changed files with 22 additions and 2 deletions

View File

@ -99,6 +99,8 @@ public:
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::VisitVAArgExpr(VAArgExpr *VE) {
void
AggExprEmitter::VisitCXXConstructExpr(const CXXConstructExpr *E) {
assert(DestPtr && "Must have a dest to emit into!");
llvm::Value *V = DestPtr;
CGF.EmitCXXConstructExpr(DestPtr, E);
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(V, E);
}
void AggExprEmitter::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
// FIXME: Do something with the temporaries!
Visit(E->getSubExpr());
}
void AggExprEmitter::EmitInitializationToLValue(Expr* E, LValue LV) {

View File

@ -269,6 +269,11 @@ public:
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