forked from OSchip/llvm-project
Implement CodeGenFunction::EmitCXXExprWithTemporariesLValue.
llvm-svn: 81738
This commit is contained in:
parent
1ce7251a0a
commit
96bad9a5cd
|
@ -111,6 +111,31 @@ CodeGenFunction::EmitCXXExprWithTemporaries(const CXXExprWithTemporaries *E,
|
|||
return RV;
|
||||
}
|
||||
|
||||
LValue CodeGenFunction::EmitCXXExprWithTemporariesLValue(
|
||||
const CXXExprWithTemporaries *E) {
|
||||
// If we shouldn't destroy the temporaries, just emit the
|
||||
// child expression.
|
||||
if (!E->shouldDestroyTemporaries())
|
||||
return EmitLValue(E->getSubExpr());
|
||||
|
||||
// Keep track of the current cleanup stack depth.
|
||||
size_t CleanupStackDepth = CleanupEntries.size();
|
||||
(void) CleanupStackDepth;
|
||||
|
||||
unsigned OldNumLiveTemporaries = LiveTemporaries.size();
|
||||
|
||||
LValue LV = EmitLValue(E->getSubExpr());
|
||||
|
||||
// Pop temporaries.
|
||||
while (LiveTemporaries.size() > OldNumLiveTemporaries)
|
||||
PopCXXTemporary();
|
||||
|
||||
assert(CleanupEntries.size() == CleanupStackDepth &&
|
||||
"Cleanup size mismatch!");
|
||||
|
||||
return LV;
|
||||
}
|
||||
|
||||
void
|
||||
CodeGenFunction::PushConditionalTempDestruction() {
|
||||
// Store the current number of live temporaries.
|
||||
|
|
|
@ -219,6 +219,8 @@ LValue CodeGenFunction::EmitLValue(const Expr *E) {
|
|||
return EmitCXXConstructLValue(cast<CXXConstructExpr>(E));
|
||||
case Expr::CXXBindTemporaryExprClass:
|
||||
return EmitCXXBindTemporaryLValue(cast<CXXBindTemporaryExpr>(E));
|
||||
case Expr::CXXExprWithTemporariesClass:
|
||||
return EmitCXXExprWithTemporariesLValue(cast<CXXExprWithTemporaries>(E));
|
||||
|
||||
case Expr::ObjCMessageExprClass:
|
||||
return EmitObjCMessageExprLValue(cast<ObjCMessageExpr>(E));
|
||||
|
|
|
@ -813,7 +813,8 @@ public:
|
|||
LValue EmitCXXConditionDeclLValue(const CXXConditionDeclExpr *E);
|
||||
LValue EmitCXXConstructLValue(const CXXConstructExpr *E);
|
||||
LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E);
|
||||
|
||||
LValue EmitCXXExprWithTemporariesLValue(const CXXExprWithTemporaries *E);
|
||||
|
||||
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E);
|
||||
LValue EmitObjCIvarRefLValue(const ObjCIvarRefExpr *E);
|
||||
LValue EmitObjCPropertyRefLValue(const ObjCPropertyRefExpr *E);
|
||||
|
|
Loading…
Reference in New Issue