diff options
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp | 1 | ||||
-rw-r--r-- | llvm/test/Instrumentation/InstrProfiling/linkage.ll | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp index 2a3d15421de..b5a491f3a40 100644 --- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -288,6 +288,7 @@ void InstrProfiling::emitRuntimeHook() { 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); diff --git a/llvm/test/Instrumentation/InstrProfiling/linkage.ll b/llvm/test/Instrumentation/InstrProfiling/linkage.ll index 0e3dd05510a..0a92d5db446 100644 --- a/llvm/test/Instrumentation/InstrProfiling/linkage.ll +++ b/llvm/test/Instrumentation/InstrProfiling/linkage.ll @@ -40,7 +40,7 @@ declare void @llvm.instrprof.increment(i8*, i64, i32, i32) ; 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: } |