From a2347baaec37ba81d64f9b455af3084cf183f127 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Fri, 18 Jul 2014 15:52:10 +0000 Subject: 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 --- clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp') diff --git a/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp b/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp index aeb920d2fd9..4bb0fee25e5 100644 --- a/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp +++ b/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp @@ -3,5 +3,5 @@ struct A { virtual void a(); }; A x(A& y) { return y; } -// CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* {{.*}}%this, %struct.A* nonnull) unnamed_addr +// CHECK: define linkonce_odr {{.*}} @_ZN1AC1ERKS_(%struct.A* {{.*}}%this, %struct.A* dereferenceable({{[0-9]+}})) unnamed_addr // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2) -- cgit v1.2.3