This symbol exists only to pull in the required pieces of the runtime,
so nothing ever needs to refer to it. Making it hidden avoids the
potential for issues with duplicate symbols when linking profiled
libraries together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230566
91177308-0d34-0410-b5e6-
96231b3b80d8
User->addFnAttr(Attribute::NoInline);
if (Options.NoRedZone)
User->addFnAttr(Attribute::NoRedZone);
+ User->setVisibility(GlobalValue::HiddenVisibility);
IRBuilder<> IRB(BasicBlock::Create(M->getContext(), "", User));
auto *Load = IRB.CreateLoad(Var);
; CHECK: @__llvm_profile_runtime = external global i32
-; CHECK: define linkonce_odr i32 @__llvm_profile_runtime_user() {{.*}} {
+; CHECK: define linkonce_odr hidden i32 @__llvm_profile_runtime_user() {{.*}} {
; CHECK: %[[REG:.*]] = load i32* @__llvm_profile_runtime
; CHECK: ret i32 %[[REG]]
; CHECK: }