diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-07 21:46:12 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-07 21:46:12 +0000 |
commit | 351241c83ea67cf4cc31b3e30b952ec45c9736e1 (patch) | |
tree | 88bbd41c8f3073d0873a01ed43bef135e0114d58 /clang/test/CodeGenCXX/exceptions.cpp | |
parent | aac71a4a0eb420173239a6acb6d192570c974464 (diff) | |
download | bcm5719-llvm-351241c83ea67cf4cc31b3e30b952ec45c9736e1.tar.gz bcm5719-llvm-351241c83ea67cf4cc31b3e30b952ec45c9736e1.zip |
Replace Sema-level implementation of -fassume-sane-operator-new with a
CodeGen-level implementation. Instead of adding an attribute to clang's
FunctionDecl, add the IR attribute directly. This means a module built with
this flag is now compatible with code built without it and vice versa.
This change also results in the 'noalias' attribute no longer being added to
calls to operator new in the IR; it's now only added to the declaration. It
also fixes a bug where we failed to add the attribute to the 'nothrow' versions
(because we didn't implicitly declare them, there was no good time to inject a
fake attribute).
llvm-svn: 265728
Diffstat (limited to 'clang/test/CodeGenCXX/exceptions.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/exceptions.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/test/CodeGenCXX/exceptions.cpp b/clang/test/CodeGenCXX/exceptions.cpp index ff76b11350d..86616d1e2c6 100644 --- a/clang/test/CodeGenCXX/exceptions.cpp +++ b/clang/test/CodeGenCXX/exceptions.cpp @@ -30,7 +30,7 @@ namespace test1 { A *a() { // CHECK: define [[A:%.*]]* @_ZN5test11aEv() - // CHECK: [[NEW:%.*]] = call noalias i8* @_Znwm(i64 8) + // CHECK: [[NEW:%.*]] = call i8* @_Znwm(i64 8) // CHECK-NEXT: [[CAST:%.*]] = bitcast i8* [[NEW]] to [[A]]* // CHECK-NEXT: invoke void @_ZN5test11AC1Ei([[A]]* [[CAST]], i32 5) // CHECK: ret [[A]]* [[CAST]] @@ -40,7 +40,7 @@ namespace test1 { A *b() { // CHECK: define [[A:%.*]]* @_ZN5test11bEv() - // CHECK: [[NEW:%.*]] = call noalias i8* @_Znwm(i64 8) + // CHECK: [[NEW:%.*]] = call i8* @_Znwm(i64 8) // CHECK-NEXT: [[CAST:%.*]] = bitcast i8* [[NEW]] to [[A]]* // CHECK-NEXT: [[FOO:%.*]] = invoke i32 @_ZN5test13fooEv() // CHECK: invoke void @_ZN5test11AC1Ei([[A]]* [[CAST]], i32 [[FOO]]) @@ -56,7 +56,7 @@ namespace test1 { A *c() { // CHECK: define [[A:%.*]]* @_ZN5test11cEv() // CHECK: [[ACTIVE:%.*]] = alloca i1 - // CHECK-NEXT: [[NEW:%.*]] = call noalias i8* @_Znwm(i64 8) + // CHECK-NEXT: [[NEW:%.*]] = call i8* @_Znwm(i64 8) // CHECK-NEXT: store i1 true, i1* [[ACTIVE]] // CHECK-NEXT: [[CAST:%.*]] = bitcast i8* [[NEW]] to [[A]]* // CHECK-NEXT: invoke void @_ZN5test11BC1Ev([[B:%.*]]* [[T0:%.*]]) @@ -82,7 +82,7 @@ namespace test1 { A *d() { // CHECK: define [[A:%.*]]* @_ZN5test11dEv() // CHECK: [[ACTIVE:%.*]] = alloca i1 - // CHECK-NEXT: [[NEW:%.*]] = call noalias i8* @_Znwm(i64 8) + // CHECK-NEXT: [[NEW:%.*]] = call i8* @_Znwm(i64 8) // CHECK-NEXT: store i1 true, i1* [[ACTIVE]] // CHECK-NEXT: [[CAST:%.*]] = bitcast i8* [[NEW]] to [[A]]* // CHECK-NEXT: invoke void @_ZN5test11BC1Ev([[B:%.*]]* [[T0:%.*]]) @@ -100,7 +100,7 @@ namespace test1 { A *e() { // CHECK: define [[A:%.*]]* @_ZN5test11eEv() // CHECK: [[ACTIVE:%.*]] = alloca i1 - // CHECK-NEXT: [[NEW:%.*]] = call noalias i8* @_Znwm(i64 8) + // CHECK-NEXT: [[NEW:%.*]] = call i8* @_Znwm(i64 8) // CHECK-NEXT: store i1 true, i1* [[ACTIVE]] // CHECK-NEXT: [[CAST:%.*]] = bitcast i8* [[NEW]] to [[A]]* // CHECK-NEXT: invoke void @_ZN5test11BC1Ev([[B:%.*]]* [[T0:%.*]]) @@ -131,7 +131,7 @@ namespace test1 { // CHECK: define [[A:%.*]]* @_ZN5test11iEv() // CHECK: [[X:%.*]] = alloca [[A]]*, align 8 // CHECK: [[ACTIVE:%.*]] = alloca i1 - // CHECK: [[NEW:%.*]] = call noalias i8* @_Znwm(i64 8) + // CHECK: [[NEW:%.*]] = call i8* @_Znwm(i64 8) // CHECK-NEXT: store i1 true, i1* [[ACTIVE]] // CHECK-NEXT: [[CAST:%.*]] = bitcast i8* [[NEW]] to [[A]]* // CHECK-NEXT: invoke void @_ZN5test15makeBEv([[B:%.*]]* sret [[T0:%.*]]) @@ -422,7 +422,7 @@ namespace test9 { return new A[10]; } // CHECK: define {{%.*}}* @_ZN5test94testEv - // CHECK: [[TEST9_NEW:%.*]] = call noalias i8* @_Znam + // CHECK: [[TEST9_NEW:%.*]] = call i8* @_Znam // CHECK: call void @_ZdaPv(i8* [[TEST9_NEW]]) } |