diff options
author | Hal Finkel <hfinkel@anl.gov> | 2014-07-18 15:52:10 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2014-07-18 15:52:10 +0000 |
commit | a2347baaec37ba81d64f9b455af3084cf183f127 (patch) | |
tree | 38de0cdf097468df1afb29d2abb642bf7bdab1f1 /clang/test/CodeGenCXX/exceptions.cpp | |
parent | b0407ba0716d940d035f5da73f6d3bfbaffecb44 (diff) | |
download | bcm5719-llvm-a2347baaec37ba81d64f9b455af3084cf183f127.tar.gz bcm5719-llvm-a2347baaec37ba81d64f9b455af3084cf183f127.zip |
Mark C++ reference parameters as dereferenceable
Because references must be initialized using some evaluated expression, they
must point to something, and a callee can assume the reference parameter is
dereferenceable. Taking advantage of a new attribute just added to LLVM, mark
them as such.
Because dereferenceability in addrspace(0) implies nonnull in the backend, we
don't need both attributes. However, we need to know the size of the object to
use the dereferenceable attribute, so for incomplete types we still emit only
nonnull.
llvm-svn: 213386
Diffstat (limited to 'clang/test/CodeGenCXX/exceptions.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/exceptions.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/exceptions.cpp b/clang/test/CodeGenCXX/exceptions.cpp index ae0c8269b6a..5016e9a794a 100644 --- a/clang/test/CodeGenCXX/exceptions.cpp +++ b/clang/test/CodeGenCXX/exceptions.cpp @@ -279,7 +279,7 @@ namespace test5 { // CHECK-NEXT: [[ADJ:%.*]] = call i8* @__cxa_get_exception_ptr(i8* [[EXN]]) // CHECK-NEXT: [[SRC:%.*]] = bitcast i8* [[ADJ]] to [[A_T]]* // CHECK-NEXT: invoke void @_ZN5test51TC1Ev([[T_T]]* [[T]]) - // CHECK: invoke void @_ZN5test51AC1ERKS0_RKNS_1TE([[A_T]]* [[A]], [[A_T]]* nonnull [[SRC]], [[T_T]]* nonnull [[T]]) + // CHECK: invoke void @_ZN5test51AC1ERKS0_RKNS_1TE([[A_T]]* [[A]], [[A_T]]* dereferenceable({{[0-9]+}}) [[SRC]], [[T_T]]* dereferenceable({{[0-9]+}}) [[T]]) // CHECK: invoke void @_ZN5test51TD1Ev([[T_T]]* [[T]]) // CHECK: call i8* @__cxa_begin_catch(i8* [[EXN]]) [[NUW]] // CHECK-NEXT: invoke void @_ZN5test51AD1Ev([[A_T]]* [[A]]) |