From 3f307518f8bea834e7ba0fb522e990063d09cfb3 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sun, 18 Sep 2016 16:12:14 +0000 Subject: CodeGen: mark ObjC cstring literals as unnamed_addr These are all emitted into a section with a cstring_literal attribute. The attribute permits the linker to coalesce the string contents. The address of the strings are not important. llvm-svn: 281855 --- clang/test/CodeGenObjCXX/encode.mm | 2 +- clang/test/CodeGenObjCXX/lambda-expressions.mm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/test/CodeGenObjCXX') diff --git a/clang/test/CodeGenObjCXX/encode.mm b/clang/test/CodeGenObjCXX/encode.mm index 26d682d39cd..5bb4a1ecfa9 100644 --- a/clang/test/CodeGenObjCXX/encode.mm +++ b/clang/test/CodeGenObjCXX/encode.mm @@ -213,7 +213,7 @@ public: dynamic_class dynamic_class_ivar; } @end -// CHECK: private constant [41 x i8] c"{dynamic_class=\22_vptr$dynamic_class\22^^?}\00" +// CHECK: private unnamed_addr constant [41 x i8] c"{dynamic_class=\22_vptr$dynamic_class\22^^?}\00" namespace PR17142 { struct A { virtual ~A(); }; diff --git a/clang/test/CodeGenObjCXX/lambda-expressions.mm b/clang/test/CodeGenObjCXX/lambda-expressions.mm index 31e84737226..35c747c71dd 100644 --- a/clang/test/CodeGenObjCXX/lambda-expressions.mm +++ b/clang/test/CodeGenObjCXX/lambda-expressions.mm @@ -6,8 +6,8 @@ fp f() { auto x = []{ return 3; }; return x; } // ARC: %[[LAMBDACLASS:.*]] = type { i32 } -// MRC: @OBJC_METH_VAR_NAME{{.*}} = private constant [5 x i8] c"copy\00" -// MRC: @OBJC_METH_VAR_NAME{{.*}} = private constant [12 x i8] c"autorelease\00" +// MRC: @OBJC_METH_VAR_NAME{{.*}} = private unnamed_addr constant [5 x i8] c"copy\00" +// MRC: @OBJC_METH_VAR_NAME{{.*}} = private unnamed_addr constant [12 x i8] c"autorelease\00" // MRC-LABEL: define i32 ()* @_Z1fv( // MRC-LABEL: define internal i32 ()* @"_ZZ1fvENK3$_0cvU13block_pointerFivEEv" // MRC: store i8* bitcast (i8** @_NSConcreteStackBlock to i8*) -- cgit v1.2.3