diff options
| author | Xinliang David Li <davidxl@google.com> | 2016-05-24 18:47:38 +0000 |
|---|---|---|
| committer | Xinliang David Li <davidxl@google.com> | 2016-05-24 18:47:38 +0000 |
| commit | f4edae6076d9c09f2c759b0b26bddf6e2eab8b13 (patch) | |
| tree | 9962d076443257e7210bac8bfd32ce9df328595b /llvm/lib | |
| parent | 141149ff4865e024a0f971f3138f226896fdeddf (diff) | |
| download | bcm5719-llvm-f4edae6076d9c09f2c759b0b26bddf6e2eab8b13.tar.gz bcm5719-llvm-f4edae6076d9c09f2c759b0b26bddf6e2eab8b13.zip | |
[profile] Fix runtime hook linkage bug for COFF
Patch by: Johan Engelen
the user hook has linkonceODR linkage and it needs to be
in comdatAny group.
llvm-svn: 270596
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp index 97e8bd1ae11..120ed18b06e 100644 --- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp @@ -550,6 +550,8 @@ void InstrProfiling::emitRuntimeHook() { User->addFnAttr(Attribute::NoInline); if (Options.NoRedZone) User->addFnAttr(Attribute::NoRedZone); User->setVisibility(GlobalValue::HiddenVisibility); + if (Triple(M->getTargetTriple()).isOSBinFormatCOFF()) + User->setComdat(M->getOrInsertComdat(User->getName())); IRBuilder<> IRB(BasicBlock::Create(M->getContext(), "", User)); auto *Load = IRB.CreateLoad(Var); |

