From 870b01ee4cdd2f02eeab02f747f20c3d3f67ad1f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 7 Mar 2018 03:00:25 +0000 Subject: [PATCH] Revert 326766 too, after r326862 the test fails and I don't know how to fix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326869 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ExprConstant.cpp | 6 +----- test/CodeGenCXX/alloc-size.cpp | 12 ------------ 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index c3e41658c2..45df133ad5 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -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(E)) - E = EC->getSubExpr()->IgnoreParens(); - + // probably be a cast of some kind. Ignore it. if (const auto *Cast = dyn_cast(E)) E = Cast->getSubExpr()->IgnoreParens(); diff --git a/test/CodeGenCXX/alloc-size.cpp b/test/CodeGenCXX/alloc-size.cpp index 5b8e1c5cf9..ac53ea8f8e 100644 --- a/test/CodeGenCXX/alloc-size.cpp +++ b/test/CodeGenCXX/alloc-size.cpp @@ -70,15 +70,3 @@ int testIt() { __builtin_object_size(dependent_calloc2(), 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); -} -- 2.40.0