]> granicus.if.org Git - clang/commitdiff
Revert 326766 too, after r326862 the test fails and I don't know how to fix.
authorNico Weber <nicolasweber@gmx.de>
Wed, 7 Mar 2018 03:00:25 +0000 (03:00 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 7 Mar 2018 03:00:25 +0000 (03:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326869 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp
test/CodeGenCXX/alloc-size.cpp

index c3e41658c29aaf050b20329a25e74e1c6fc027a6..45df133ad57a86f8d66ba5954c6968adbf5466f2 100644 (file)
@@ -133,11 +133,7 @@ namespace {
 
     E = E->IgnoreParens();
     // If we're doing a variable assignment from e.g. malloc(N), there will
-    // probably be a cast of some kind. In exotic cases, we might also see a
-    // top-level ExprWithCleanups. Ignore them either way.
-    if (const auto *EC = dyn_cast<ExprWithCleanups>(E))
-      E = EC->getSubExpr()->IgnoreParens();
-
+    // probably be a cast of some kind. Ignore it.
     if (const auto *Cast = dyn_cast<CastExpr>(E))
       E = Cast->getSubExpr()->IgnoreParens();
 
index 5b8e1c5cf96511ed18a08642ee1cb49e0a44bf0d..ac53ea8f8ea216f2a4aeece306ce6acdd76b437b 100644 (file)
@@ -70,15 +70,3 @@ int testIt() {
          __builtin_object_size(dependent_calloc2<int, 9>(), 0);
 }
 } // namespace templated_alloc_size
-
-struct D {
-  ~D();
-  void *my_malloc(int N) __attribute__((alloc_size(2)));
-};
-
-// CHECK-LABEL: define i32 @_Z20callExprWithCleanupsv
-int callExprWithCleanups() {
-  int *const p = (int *)D().my_malloc(3);
-  // CHECK: ret i32 3
-  return __builtin_object_size(p, 0);
-}