summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorTim Shen <timshen91@gmail.com>2016-06-09 21:13:39 +0000
committerTim Shen <timshen91@gmail.com>2016-06-09 21:13:39 +0000
commit17b3deeff3f0b246789c37911a445dbd4ad3456f (patch)
treee03729ec0980541f07ba560ef329fb47b3443254 /clang/lib/AST
parentee2ce4a50e16548cd4274e8532491cc8b06d7a8d (diff)
downloadbcm5719-llvm-17b3deeff3f0b246789c37911a445dbd4ad3456f.tar.gz
bcm5719-llvm-17b3deeff3f0b246789c37911a445dbd4ad3456f.zip
Revert "[Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr."
This reverts r272296, since there are clang-tidy failures that appear to be caused by this change. llvm-svn: 272310
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/Expr.cpp7
-rw-r--r--clang/lib/AST/ExprCXX.cpp6
2 files changed, 2 insertions, 11 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index dc87c0a8e26..4c0492c3935 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -2890,6 +2890,7 @@ bool Expr::HasSideEffects(const ASTContext &Ctx,
case CXXThrowExprClass:
case CXXNewExprClass:
case CXXDeleteExprClass:
+ case ExprWithCleanupsClass:
case CoawaitExprClass:
case CoyieldExprClass:
// These always have a side-effect.
@@ -2902,12 +2903,6 @@ bool Expr::HasSideEffects(const ASTContext &Ctx,
return Finder.hasSideEffects();
}
- case ExprWithCleanupsClass:
- if (IncludePossibleEffects)
- if (cast<ExprWithCleanups>(this)->cleanupsHaveSideEffects())
- return true;
- break;
-
case ParenExprClass:
case ArraySubscriptExprClass:
case OMPArraySectionExprClass:
diff --git a/clang/lib/AST/ExprCXX.cpp b/clang/lib/AST/ExprCXX.cpp
index 7978b0a90aa..dbfe58c8b3d 100644
--- a/clang/lib/AST/ExprCXX.cpp
+++ b/clang/lib/AST/ExprCXX.cpp
@@ -1039,7 +1039,6 @@ bool LambdaExpr::isMutable() const {
}
ExprWithCleanups::ExprWithCleanups(Expr *subexpr,
- bool CleanupsHaveSideEffects,
ArrayRef<CleanupObject> objects)
: Expr(ExprWithCleanupsClass, subexpr->getType(),
subexpr->getValueKind(), subexpr->getObjectKind(),
@@ -1047,19 +1046,16 @@ ExprWithCleanups::ExprWithCleanups(Expr *subexpr,
subexpr->isInstantiationDependent(),
subexpr->containsUnexpandedParameterPack()),
SubExpr(subexpr) {
- ExprWithCleanupsBits.CleanupsHaveSideEffects = CleanupsHaveSideEffects;
ExprWithCleanupsBits.NumObjects = objects.size();
for (unsigned i = 0, e = objects.size(); i != e; ++i)
getTrailingObjects<CleanupObject>()[i] = objects[i];
}
ExprWithCleanups *ExprWithCleanups::Create(const ASTContext &C, Expr *subexpr,
- bool CleanupsHaveSideEffects,
ArrayRef<CleanupObject> objects) {
void *buffer = C.Allocate(totalSizeToAlloc<CleanupObject>(objects.size()),
llvm::alignOf<ExprWithCleanups>());
- return new (buffer)
- ExprWithCleanups(subexpr, CleanupsHaveSideEffects, objects);
+ return new (buffer) ExprWithCleanups(subexpr, objects);
}
ExprWithCleanups::ExprWithCleanups(EmptyShell empty, unsigned numObjects)
OpenPOWER on IntegriCloud