From 2e217d6555dc101a55e6391adce063e7d0b77dbd Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 17 Jan 2011 22:22:52 +0000 Subject: [PATCH] More unnamed_addr. llvm-svn: 123681 --- clang/lib/CodeGen/CodeGenModule.cpp | 1 + clang/test/CodeGen/annotate.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 0564372a4e5d..ed3a117ef773 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -630,6 +630,7 @@ llvm::Constant *CodeGenModule::EmitAnnotateAttr(llvm::GlobalValue *GV, new llvm::GlobalVariable(*M, unit->getType(), false, llvm::GlobalValue::PrivateLinkage, unit, ".str"); + unitGV->setUnnamedAddr(true); // Create the ConstantStruct for the global annotation. llvm::Constant *Fields[4] = { diff --git a/clang/test/CodeGen/annotate.c b/clang/test/CodeGen/annotate.c index 84d564a61f71..ffaeebbca515 100644 --- a/clang/test/CodeGen/annotate.c +++ b/clang/test/CodeGen/annotate.c @@ -5,4 +5,6 @@ void a(char *a) { __attribute__((annotate("bar"))) static char bar; } +// CHECK: private unnamed_addr global +// CHECK: private unnamed_addr global // CHECK: @llvm.global.annotations = appending global [2 x %0]