aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-06 08:20:24 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-06 08:20:24 +0000
commit4765fa05b5652fcc4356371c2f481d0ea9a1b007 (patch)
tree82e9de9098859a89427f187c0a7eaae82ab788e2 /lib
parentcd940a1e13e588a43973cd7ae33b5c33a3062739 (diff)
Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical
reason this is limited to C++, and it's certainly not limited to temporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/Decl.cpp7
-rw-r--r--lib/AST/DeclPrinter.cpp3
-rw-r--r--lib/AST/Expr.cpp6
-rw-r--r--lib/AST/ExprCXX.cpp28
-rw-r--r--lib/AST/ExprClassification.cpp6
-rw-r--r--lib/AST/ExprConstant.cpp2
-rw-r--r--lib/AST/StmtDumper.cpp4
-rw-r--r--lib/AST/StmtPrinter.cpp2
-rw-r--r--lib/AST/StmtProfile.cpp5
-rw-r--r--lib/Analysis/CFG.cpp20
-rw-r--r--lib/Checker/CheckDeadStores.cpp2
-rw-r--r--lib/Checker/Environment.cpp4
-rw-r--r--lib/Checker/GRExprEngine.cpp6
-rw-r--r--lib/Checker/LLVMConventionsChecker.cpp2
-rw-r--r--lib/CodeGen/CGException.cpp2
-rw-r--r--lib/CodeGen/CGExpr.cpp6
-rw-r--r--lib/CodeGen/CGExprAgg.cpp6
-rw-r--r--lib/CodeGen/CGExprCXX.cpp2
-rw-r--r--lib/CodeGen/CGExprComplex.cpp4
-rw-r--r--lib/CodeGen/CGExprScalar.cpp4
-rw-r--r--lib/CodeGen/CGTemporaries.cpp7
-rw-r--r--lib/CodeGen/CodeGenFunction.h6
-rw-r--r--lib/CodeGen/Mangle.cpp4
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp2
-rw-r--r--lib/Sema/SemaDecl.cpp6
-rw-r--r--lib/Sema/SemaDeclCXX.cpp20
-rw-r--r--lib/Sema/SemaExpr.cpp2
-rw-r--r--lib/Sema/SemaExprCXX.cpp20
-rw-r--r--lib/Sema/SemaObjCProperty.cpp2
-rw-r--r--lib/Sema/SemaStmt.cpp14
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp2
-rw-r--r--lib/Sema/TreeTransform.h9
-rw-r--r--lib/Serialization/ASTReaderStmt.cpp8
-rw-r--r--lib/Serialization/ASTWriterStmt.cpp6
34 files changed, 111 insertions, 118 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index ce76cfb6bb..a8959b8d91 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1176,15 +1176,14 @@ Expr *ParmVarDecl::getDefaultArg() {
"Default argument is not yet instantiated!");
Expr *Arg = getInit();
- if (CXXExprWithTemporaries *E = dyn_cast_or_null<CXXExprWithTemporaries>(Arg))
+ if (ExprWithCleanups *E = dyn_cast_or_null<ExprWithCleanups>(Arg))
return E->getSubExpr();
return Arg;
}
unsigned ParmVarDecl::getNumDefaultArgTemporaries() const {
- if (const CXXExprWithTemporaries *E =
- dyn_cast<CXXExprWithTemporaries>(getInit()))
+ if (const ExprWithCleanups *E = dyn_cast<ExprWithCleanups>(getInit()))
return E->getNumTemporaries();
return 0;
@@ -1194,7 +1193,7 @@ CXXTemporary *ParmVarDecl::getDefaultArgTemporary(unsigned i) {
assert(getNumDefaultArgTemporaries() &&
"Default arguments does not have any temporaries!");
- CXXExprWithTemporaries *E = cast<CXXExprWithTemporaries>(getInit());
+ ExprWithCleanups *E = cast<ExprWithCleanups>(getInit());
return E->getTemporary(i);
}
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index dc1a9dc888..3eded8f7dc 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -449,8 +449,7 @@ void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
// Nothing to print
} else {
Expr *Init = BMInitializer->getInit();
- if (CXXExprWithTemporaries *Tmp
- = dyn_cast<CXXExprWithTemporaries>(Init))
+ if (ExprWithCleanups *Tmp = dyn_cast<ExprWithCleanups>(Init))
Init = Tmp->getSubExpr();
Init = Init->IgnoreParens();
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index eef45e388a..eef5cd16e4 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1407,8 +1407,8 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1,
case CXXBindTemporaryExprClass:
return (cast<CXXBindTemporaryExpr>(this)
->getSubExpr()->isUnusedResultAWarning(Loc, R1, R2, Ctx));
- case CXXExprWithTemporariesClass:
- return (cast<CXXExprWithTemporaries>(this)
+ case ExprWithCleanupsClass:
+ return (cast<ExprWithCleanups>(this)
->getSubExpr()->isUnusedResultAWarning(Loc, R1, R2, Ctx));
}
}
@@ -1643,7 +1643,7 @@ Expr::CanThrowResult Expr::CanThrow(ASTContext &C) const {
case ParenListExprClass:
case VAArgExprClass:
case CXXDefaultArgExprClass:
- case CXXExprWithTemporariesClass:
+ case ExprWithCleanupsClass:
case ObjCIvarRefExprClass:
case ObjCIsaExprClass:
case ShuffleVectorExprClass:
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 6260330f9f..a6d6f48606 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -615,11 +615,11 @@ CXXConstructExpr::CXXConstructExpr(ASTContext &C, StmtClass SC, QualType T,
}
}
-CXXExprWithTemporaries::CXXExprWithTemporaries(ASTContext &C,
- Expr *subexpr,
- CXXTemporary **temps,
- unsigned numtemps)
- : Expr(CXXExprWithTemporariesClass, subexpr->getType(),
+ExprWithCleanups::ExprWithCleanups(ASTContext &C,
+ Expr *subexpr,
+ CXXTemporary **temps,
+ unsigned numtemps)
+ : Expr(ExprWithCleanupsClass, subexpr->getType(),
subexpr->getValueKind(), subexpr->getObjectKind(),
subexpr->isTypeDependent(), subexpr->isValueDependent()),
SubExpr(subexpr), Temps(0), NumTemps(0) {
@@ -630,18 +630,18 @@ CXXExprWithTemporaries::CXXExprWithTemporaries(ASTContext &C,
}
}
-void CXXExprWithTemporaries::setNumTemporaries(ASTContext &C, unsigned N) {
+void ExprWithCleanups::setNumTemporaries(ASTContext &C, unsigned N) {
assert(Temps == 0 && "Cannot resize with this");
NumTemps = N;
Temps = new (C) CXXTemporary*[NumTemps];
}
-CXXExprWithTemporaries *CXXExprWithTemporaries::Create(ASTContext &C,
- Expr *SubExpr,
- CXXTemporary **Temps,
- unsigned NumTemps) {
- return new (C) CXXExprWithTemporaries(C, SubExpr, Temps, NumTemps);
+ExprWithCleanups *ExprWithCleanups::Create(ASTContext &C,
+ Expr *SubExpr,
+ CXXTemporary **Temps,
+ unsigned NumTemps) {
+ return new (C) ExprWithCleanups(C, SubExpr, Temps, NumTemps);
}
// CXXBindTemporaryExpr
@@ -661,12 +661,12 @@ Stmt::child_iterator CXXConstructExpr::child_end() {
return &Args[0]+NumArgs;
}
-// CXXExprWithTemporaries
-Stmt::child_iterator CXXExprWithTemporaries::child_begin() {
+// ExprWithCleanups
+Stmt::child_iterator ExprWithCleanups::child_begin() {
return &SubExpr;
}
-Stmt::child_iterator CXXExprWithTemporaries::child_end() {
+Stmt::child_iterator ExprWithCleanups::child_end() {
return &SubExpr + 1;
}
diff --git a/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp
index a43bea298e..3788dc743f 100644
--- a/lib/AST/ExprClassification.cpp
+++ b/lib/AST/ExprClassification.cpp
@@ -255,9 +255,9 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
case Expr::CXXBindTemporaryExprClass:
return ClassifyInternal(Ctx, cast<CXXBindTemporaryExpr>(E)->getSubExpr());
- // And the temporary lifetime guard.
- case Expr::CXXExprWithTemporariesClass:
- return ClassifyInternal(Ctx, cast<CXXExprWithTemporaries>(E)->getSubExpr());
+ // And the cleanups guard.
+ case Expr::ExprWithCleanupsClass:
+ return ClassifyInternal(Ctx, cast<ExprWithCleanups>(E)->getSubExpr());
// Casts depend completely on the target type. All casts work the same.
case Expr::CStyleCastExprClass:
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 019cfc9b80..a79ae82a34 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -2494,7 +2494,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) {
case Expr::DependentScopeDeclRefExprClass:
case Expr::CXXConstructExprClass:
case Expr::CXXBindTemporaryExprClass:
- case Expr::CXXExprWithTemporariesClass:
+ case Expr::ExprWithCleanupsClass:
case Expr::CXXTemporaryObjectExprClass:
case Expr::CXXUnresolvedConstructExprClass:
case Expr::CXXDependentScopeMemberExprClass:
diff --git a/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp
index 6f9a2d574b..67ba3ec9c7 100644
--- a/lib/AST/StmtDumper.cpp
+++ b/lib/AST/StmtDumper.cpp
@@ -161,7 +161,7 @@ namespace {
void VisitCXXFunctionalCastExpr(CXXFunctionalCastExpr *Node);
void VisitCXXConstructExpr(CXXConstructExpr *Node);
void VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *Node);
- void VisitCXXExprWithTemporaries(CXXExprWithTemporaries *Node);
+ void VisitExprWithCleanups(ExprWithCleanups *Node);
void VisitUnresolvedLookupExpr(UnresolvedLookupExpr *Node);
void DumpCXXTemporary(CXXTemporary *Temporary);
@@ -534,7 +534,7 @@ void StmtDumper::VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *Node) {
DumpCXXTemporary(Node->getTemporary());
}
-void StmtDumper::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *Node) {
+void StmtDumper::VisitExprWithCleanups(ExprWithCleanups *Node) {
DumpExpr(Node);
++IndentLevel;
for (unsigned i = 0, e = Node->getNumTemporaries(); i != e; ++i) {
diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index 9dfde62deb..aba4d7e389 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -1142,7 +1142,7 @@ void StmtPrinter::VisitCXXConstructExpr(CXXConstructExpr *E) {
// Nothing to print.
}
-void StmtPrinter::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
+void StmtPrinter::VisitExprWithCleanups(ExprWithCleanups *E) {
// Just forward to the sub expression.
PrintExpr(E->getSubExpr());
}
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp
index 7f10bef713..10cba341af 100644
--- a/lib/AST/StmtProfile.cpp
+++ b/lib/AST/StmtProfile.cpp
@@ -790,11 +790,8 @@ StmtProfiler::VisitDependentScopeDeclRefExpr(DependentScopeDeclRefExpr *S) {
VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs());
}
-void StmtProfiler::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *S) {
+void StmtProfiler::VisitExprWithCleanups(ExprWithCleanups *S) {
VisitExpr(S);
- for (unsigned I = 0, N = S->getNumTemporaries(); I != N; ++I)
- VisitDecl(
- const_cast<CXXDestructorDecl *>(S->getTemporary(I)->getDestructor()));
}
void
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp
index 9ff4e3897d..35d93867c1 100644
--- a/lib/Analysis/CFG.cpp
+++ b/lib/Analysis/CFG.cpp
@@ -290,7 +290,7 @@ private:
CFGBlock *VisitBlockExpr(BlockExpr* E, AddStmtChoice asc);
CFGBlock *VisitBreakStmt(BreakStmt *B);
CFGBlock *VisitCXXCatchStmt(CXXCatchStmt *S);
- CFGBlock *VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E,
+ CFGBlock *VisitExprWithCleanups(ExprWithCleanups *E,
AddStmtChoice asc);
CFGBlock *VisitCXXThrowExpr(CXXThrowExpr *T);
CFGBlock *VisitCXXTryStmt(CXXTryStmt *S);
@@ -555,11 +555,11 @@ CFGBlock *CFGBuilder::addInitializer(CXXBaseOrMemberInitializer *I) {
if (Init) {
if (FieldDecl *FD = I->getAnyMember())
IsReference = FD->getType()->isReferenceType();
- HasTemporaries = isa<CXXExprWithTemporaries>(Init);
+ HasTemporaries = isa<ExprWithCleanups>(Init);
if (BuildOpts.AddImplicitDtors && HasTemporaries) {
// Generate destructors for temporaries in initialization expression.
- VisitForTemporaryDtors(cast<CXXExprWithTemporaries>(Init)->getSubExpr(),
+ VisitForTemporaryDtors(cast<ExprWithCleanups>(Init)->getSubExpr(),
IsReference);
}
}
@@ -572,7 +572,7 @@ CFGBlock *CFGBuilder::addInitializer(CXXBaseOrMemberInitializer *I) {
if (HasTemporaries)
// For expression with temporaries go directly to subexpression to omit
// generating destructors for the second time.
- return Visit(cast<CXXExprWithTemporaries>(Init)->getSubExpr(), asc);
+ return Visit(cast<ExprWithCleanups>(Init)->getSubExpr(), asc);
return Visit(Init, asc);
}
@@ -839,8 +839,8 @@ tryAgain:
case Stmt::CXXCatchStmtClass:
return VisitCXXCatchStmt(cast<CXXCatchStmt>(S));
- case Stmt::CXXExprWithTemporariesClass:
- return VisitCXXExprWithTemporaries(cast<CXXExprWithTemporaries>(S), asc);
+ case Stmt::ExprWithCleanupsClass:
+ return VisitExprWithCleanups(cast<ExprWithCleanups>(S), asc);
case Stmt::CXXBindTemporaryExprClass:
return VisitCXXBindTemporaryExpr(cast<CXXBindTemporaryExpr>(S), asc);
@@ -1322,11 +1322,11 @@ CFGBlock *CFGBuilder::VisitDeclSubExpr(DeclStmt* DS) {
Expr *Init = VD->getInit();
if (Init) {
IsReference = VD->getType()->isReferenceType();
- HasTemporaries = isa<CXXExprWithTemporaries>(Init);
+ HasTemporaries = isa<ExprWithCleanups>(Init);
if (BuildOpts.AddImplicitDtors && HasTemporaries) {
// Generate destructors for temporaries in initialization expression.
- VisitForTemporaryDtors(cast<CXXExprWithTemporaries>(Init)->getSubExpr(),
+ VisitForTemporaryDtors(cast<ExprWithCleanups>(Init)->getSubExpr(),
IsReference);
}
}
@@ -1339,7 +1339,7 @@ CFGBlock *CFGBuilder::VisitDeclSubExpr(DeclStmt* DS) {
if (HasTemporaries)
// For expression with temporaries go directly to subexpression to omit
// generating destructors for the second time.
- Visit(cast<CXXExprWithTemporaries>(Init)->getSubExpr(), asc);
+ Visit(cast<ExprWithCleanups>(Init)->getSubExpr(), asc);
else
Visit(Init, asc);
}
@@ -2411,7 +2411,7 @@ CFGBlock* CFGBuilder::VisitCXXCatchStmt(CXXCatchStmt* CS) {
return CatchBlock;
}
-CFGBlock *CFGBuilder::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E,
+CFGBlock *CFGBuilder::VisitExprWithCleanups(ExprWithCleanups *E,
AddStmtChoice asc) {
if (BuildOpts.AddImplicitDtors) {
// If adding implicit destructors visit the full expression for adding
diff --git a/lib/Checker/CheckDeadStores.cpp b/lib/Checker/CheckDeadStores.cpp
index 38961000d3..63b2f563ca 100644
--- a/lib/Checker/CheckDeadStores.cpp
+++ b/lib/Checker/CheckDeadStores.cpp
@@ -203,7 +203,7 @@ public:
if (isa<CXXConstructExpr>(E))
return;
- if (isa<CXXExprWithTemporaries>(E))
+ if (isa<ExprWithCleanups>(E))
return;
// A dead initialization is a variable that is dead after it
diff --git a/lib/Checker/Environment.cpp b/lib/Checker/Environment.cpp
index 086d982ad5..f2893ea95e 100644
--- a/lib/Checker/Environment.cpp
+++ b/lib/Checker/Environment.cpp
@@ -69,8 +69,8 @@ SVal Environment::getSVal(const Stmt *E, SValBuilder& svalBuilder) const {
}
break;
}
- case Stmt::CXXExprWithTemporariesClass:
- E = cast<CXXExprWithTemporaries>(E)->getSubExpr();
+ case Stmt::ExprWithCleanupsClass:
+ E = cast<ExprWithCleanups>(E)->getSubExpr();
continue;
case Stmt::CXXBindTemporaryExprClass:
E = cast<CXXBindTemporaryExpr>(E)->getSubExpr();
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index c40c34118e..4d6dc13c36 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -797,7 +797,7 @@ void GRExprEngine::Visit(const Stmt* S, ExplodedNode* Pred,
case Stmt::CXXCatchStmtClass:
case Stmt::CXXDefaultArgExprClass:
case Stmt::CXXDependentScopeMemberExprClass:
- case Stmt::CXXExprWithTemporariesClass:
+ case Stmt::ExprWithCleanupsClass:
case Stmt::CXXNullPtrLiteralExprClass:
case Stmt::CXXPseudoDestructorExprClass:
case Stmt::CXXTemporaryObjectExprClass:
@@ -1154,8 +1154,8 @@ void GRExprEngine::VisitLValue(const Expr* Ex, ExplodedNode* Pred,
break;
}
- case Stmt::CXXExprWithTemporariesClass: {
- const CXXExprWithTemporaries *expr = cast<CXXExprWithTemporaries>(Ex);
+ case Stmt::ExprWithCleanupsClass: {
+ const ExprWithCleanups *expr = cast<ExprWithCleanups>(Ex);
VisitLValue(expr->getSubExpr(), Pred, Dst);
break;
}
diff --git a/lib/Checker/LLVMConventionsChecker.cpp b/lib/Checker/LLVMConventionsChecker.cpp
index 2f87da142c..efc1d9820a 100644
--- a/lib/Checker/LLVMConventionsChecker.cpp
+++ b/lib/Checker/LLVMConventionsChecker.cpp
@@ -153,7 +153,7 @@ void StringRefCheckerVisitor::VisitVarDecl(VarDecl *VD) {
// llvm::StringRef x = call() (where call returns std::string)
if (!IsLLVMStringRef(VD->getType()))
return;
- CXXExprWithTemporaries *Ex1 = dyn_cast<CXXExprWithTemporaries>(Init);
+ ExprWithCleanups *Ex1 = dyn_cast<ExprWithCleanups>(Init);
if (!Ex1)
return;
CXXConstructExpr *Ex2 = dyn_cast<CXXConstructExpr>(Ex1->getSubExpr());
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index 22ce184eb5..11e5e64528 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -547,7 +547,7 @@ static void EmitAnyExprToExn(CodeGenFunction &CGF, const Expr *E,
// Technically, the exception object is like a temporary; it has to
// be cleaned up when its full-expression is complete.
// Unfortunately, the AST represents full-expressions by creating a
- // CXXExprWithTemporaries, which it only does when there are actually
+ // ExprWithCleanups, which it only does when there are actually
// temporaries.
//
// If any cleanups have been added since we pushed ours, they must
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 6cc573c0cf..4c6d841962 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -192,7 +192,7 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E,
if (const CXXDefaultArgExpr *DAE = dyn_cast<CXXDefaultArgExpr>(E))
E = DAE->getExpr();
- if (const CXXExprWithTemporaries *TE = dyn_cast<CXXExprWithTemporaries>(E)) {
+ if (const ExprWithCleanups *TE = dyn_cast<ExprWithCleanups>(E)) {
CodeGenFunction::RunCleanupsScope Scope(CGF);
return EmitExprForReferenceBinding(CGF, TE->getSubExpr(),
@@ -537,8 +537,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::ExprWithCleanupsClass:
+ return EmitExprWithCleanupsLValue(cast<ExprWithCleanups>(E));
case Expr::CXXScalarValueInitExprClass:
return EmitNullInitializationLValue(cast<CXXScalarValueInitExpr>(E));
case Expr::CXXDefaultArgExprClass:
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index ffe1739a0e..cf1c7415bc 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -125,7 +125,7 @@ public:
}
void VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E);
void VisitCXXConstructExpr(const CXXConstructExpr *E);
- void VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E);
+ void VisitExprWithCleanups(ExprWithCleanups *E);
void VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E);
void VisitCXXTypeidExpr(CXXTypeidExpr *E) { EmitAggLoadOfLValue(E); }
@@ -487,8 +487,8 @@ AggExprEmitter::VisitCXXConstructExpr(const CXXConstructExpr *E) {
CGF.EmitCXXConstructExpr(E, Slot);
}
-void AggExprEmitter::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
- CGF.EmitCXXExprWithTemporaries(E, Dest);
+void AggExprEmitter::VisitExprWithCleanups(ExprWithCleanups *E) {
+ CGF.EmitExprWithCleanups(E, Dest);
}
void AggExprEmitter::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 945aa2a182..87e9cc89e0 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -311,7 +311,7 @@ void
CodeGenFunction::EmitSynthesizedCXXCopyCtor(llvm::Value *Dest,
llvm::Value *Src,
const Expr *Exp) {
- if (const CXXExprWithTemporaries *E = dyn_cast<CXXExprWithTemporaries>(Exp))
+ if (const ExprWithCleanups *E = dyn_cast<ExprWithCleanups>(Exp))
Exp = E->getSubExpr();
assert(isa<CXXConstructExpr>(Exp) &&
"EmitSynthesizedCXXCopyCtor - unknown copy ctor expr");
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp
index 7896504d86..cf1e3f11c4 100644
--- a/lib/CodeGen/CGExprComplex.cpp
+++ b/lib/CodeGen/CGExprComplex.cpp
@@ -177,8 +177,8 @@ public:
ComplexPairTy VisitCXXDefaultArgExpr(CXXDefaultArgExpr *DAE) {
return Visit(DAE->getExpr());
}
- ComplexPairTy VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
- return CGF.EmitCXXExprWithTemporaries(E).getComplexVal();
+ ComplexPairTy VisitExprWithCleanups(ExprWithCleanups *E) {
+ return CGF.EmitExprWithCleanups(E).getComplexVal();
}
ComplexPairTy VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
assert(E->getType()->isAnyComplexType() && "Expected complex type!");
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index d4bd170e8d..841f1299d2 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -339,8 +339,8 @@ public:
return CGF.LoadCXXThis();
}
- Value *VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) {
- return CGF.EmitCXXExprWithTemporaries(E).getScalarVal();
+ Value *VisitExprWithCleanups(ExprWithCleanups *E) {
+ return CGF.EmitExprWithCleanups(E).getScalarVal();
}
Value *VisitCXXNewExpr(const CXXNewExpr *E) {
return CGF.EmitCXXNewExpr(E);
diff --git a/lib/CodeGen/CGTemporaries.cpp b/lib/CodeGen/CGTemporaries.cpp
index ba01b72e54..6dd3a2e8bd 100644
--- a/lib/CodeGen/CGTemporaries.cpp
+++ b/lib/CodeGen/CGTemporaries.cpp
@@ -76,14 +76,13 @@ void CodeGenFunction::EmitCXXTemporary(const CXXTemporary *Temporary,
}
RValue
-CodeGenFunction::EmitCXXExprWithTemporaries(const CXXExprWithTemporaries *E,
- AggValueSlot Slot) {
+CodeGenFunction::EmitExprWithCleanups(const ExprWithCleanups *E,
+ AggValueSlot Slot) {
RunCleanupsScope Scope(*this);
return EmitAnyExpr(E->getSubExpr(), Slot);
}
-LValue CodeGenFunction::EmitCXXExprWithTemporariesLValue(
- const CXXExprWithTemporaries *E) {
+LValue CodeGenFunction::EmitExprWithCleanupsLValue(const ExprWithCleanups *E) {
RunCleanupsScope Scope(*this);
return EmitLValue(E->getSubExpr());
}
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index f7bd4ab97d..2f6c58e779 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -1456,7 +1456,7 @@ public:
LValue EmitCXXConstructLValue(const CXXConstructExpr *E);
LValue EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E);
- LValue EmitCXXExprWithTemporariesLValue(const CXXExprWithTemporaries *E);
+ LValue EmitExprWithCleanupsLValue(const ExprWithCleanups *E);
LValue EmitCXXTypeidLValue(const CXXTypeidExpr *E);
LValue EmitObjCMessageExprLValue(const ObjCMessageExpr *E);
@@ -1656,8 +1656,8 @@ public:
void EmitSynthesizedCXXCopyCtor(llvm::Value *Dest, llvm::Value *Src,
const Expr *Exp);
- RValue EmitCXXExprWithTemporaries(const CXXExprWithTemporaries *E,
- AggValueSlot Slot =AggValueSlot::ignored());
+ RValue EmitExprWithCleanups(const ExprWithCleanups *E,
+ AggValueSlot Slot =AggValueSlot::ignored());
void EmitCXXThrowExpr(const CXXThrowExpr *E);
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 0d4cebf7d5..24790b8df2 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -1960,8 +1960,8 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) {
mangleExpression(cast<CXXBindTemporaryExpr>(E)->getSubExpr());
break;
- case Expr::CXXExprWithTemporariesClass:
- mangleExpression(cast<CXXExprWithTemporaries>(E)->getSubExpr(), Arity);
+ case Expr::ExprWithCleanupsClass:
+ mangleExpression(cast<ExprWithCleanups>(E)->getSubExpr(), Arity);
break;
case Expr::FloatingLiteralClass: {
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index 297d010995..a9001c6e76 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -179,7 +179,7 @@ static ControlFlowKind CheckFallThrough(AnalysisContext &AC) {
}
// FIXME: Remove this hack once temporaries and their destructors are
// modeled correctly by the CFG.
- if (CXXExprWithTemporaries *E = dyn_cast<CXXExprWithTemporaries>(S)) {
+ if (ExprWithCleanups *E = dyn_cast<ExprWithCleanups>(S)) {
for (unsigned I = 0, N = E->getNumTemporaries(); I != N; ++I) {
const FunctionDecl *FD = E->getTemporary(I)->getDestructor();
if (FD->hasAttr<NoReturnAttr>() ||
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index ff90670b7c..aa2e2a53d6 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3037,7 +3037,7 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
SourceLocation(),
Owned(E));
if (!Res.isInvalid()) {
- Res = MaybeCreateCXXExprWithTemporaries(Res.get());
+ Res = MaybeCreateExprWithCleanups(Res.get());
Expr *Init = Res.takeAs<Expr>();
Context.setBlockVarCopyInits(NewVD, Init);
}
@@ -4589,7 +4589,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) {
// Check any implicit conversions within the expression.
CheckImplicitConversions(Init, VDecl->getLocation());
- Init = MaybeCreateCXXExprWithTemporaries(Init);
+ Init = MaybeCreateExprWithCleanups(Init);
// Attach the initializer to the decl.
VDecl->setInit(Init);
@@ -4805,7 +4805,7 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl,
if (Init.isInvalid())
Var->setInvalidDecl();
else if (Init.get()) {
- Var->setInit(MaybeCreateCXXExprWithTemporaries(Init.takeAs<Expr>()));
+ Var->setInit(MaybeCreateExprWithCleanups(Init.takeAs<Expr>()));
if (getLangOptions().CPlusPlus && !Var->isInvalidDecl() &&
Var->hasGlobalStorage() && !Var->isStaticLocal() &&
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 49cc993096..8be402fb5b 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -137,7 +137,7 @@ Sema::SetParamDefaultArgument(ParmVarDecl *Param, Expr *Arg,
Arg = Result.takeAs<Expr>();
CheckImplicitConversions(Arg, EqualLoc);
- Arg = MaybeCreateCXXExprWithTemporaries(Arg);
+ Arg = MaybeCreateExprWithCleanups(Arg);
// Okay: add the default argument to the parameter
Param->setDefaultArg(Arg);
@@ -311,7 +311,