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/implicit-copy-constructor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/test/CodeGenCXX/implicit-copy-constructor.cpp') diff --git a/clang/test/CodeGenCXX/implicit-copy-constructor.cpp b/clang/test/CodeGenCXX/implicit-copy-constructor.cpp index fa6be99d114..d0224131c4d 100644 --- a/clang/test/CodeGenCXX/implicit-copy-constructor.cpp +++ b/clang/test/CodeGenCXX/implicit-copy-constructor.cpp @@ -40,7 +40,7 @@ void f(D d) { D d2(d); } -// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D* nonnull) unnamed_addr +// CHECK-LABEL: define linkonce_odr void @_ZN1DC1ERS_(%struct.D* %this, %struct.D* dereferenceable({{[0-9]+}})) unnamed_addr // CHECK: call void @_ZN1AC1Ev // CHECK: call void @_ZN1CC2ERS_1A // CHECK: call void @_ZN1AD1Ev -- cgit v1.2.3