aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-12-21 21:00:33 +0000
committerXinliang David Li <davidxl@google.com>2015-12-21 21:00:33 +0000
commit13da1f149e013df96d58eb04810e55203473b2e2 (patch)
tree6fde63a4fb90ad12317f8e6b93eeb5a0a7a13068 /llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
parent167e62f8c130cc01285e5c1bcc7be2e9e8053d66 (diff)
downloadllvm-13da1f149e013df96d58eb04810e55203473b2e2.zip
llvm-13da1f149e013df96d58eb04810e55203473b2e2.tar.gz
llvm-13da1f149e013df96d58eb04810e55203473b2e2.tar.bz2
Revert r256193: build bot failure triggered
llvm-svn: 256198
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index 0c0b54f..57ed2f7 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -279,16 +279,6 @@ static inline bool shouldRecordFunctionAddr(Function *F) {
return F->hasAddressTaken();
}
-static inline Comdat *getOrCreateProfileComdat(Module &M,
- InstrProfIncrementInst *Inc) {
- // COFF format requires a COMDAT section to have a key symbol with the same
- // name.
- StringRef ComdatPrefix = (Triple(M.getTargetTriple()).isOSBinFormatCOFF()
- ? getInstrProfDataVarPrefix()
- : getInstrProfComdatPrefix());
- return M.getOrInsertComdat(StringRef(getVarName(Inc, ComdatPrefix)));
-}
-
GlobalVariable *
InstrProfiling::getOrCreateRegionCounters(InstrProfIncrementInst *Inc) {
GlobalVariable *NamePtr = Inc->getName();
@@ -307,7 +297,8 @@ InstrProfiling::getOrCreateRegionCounters(InstrProfIncrementInst *Inc) {
Function *Fn = Inc->getParent()->getParent();
Comdat *ProfileVarsComdat = nullptr;
if (Fn->hasComdat())
- ProfileVarsComdat = getOrCreateProfileComdat(*M, Inc);
+ ProfileVarsComdat = M->getOrInsertComdat(
+ StringRef(getVarName(Inc, getInstrProfComdatPrefix())));
NamePtr->setSection(getNameSection());
NamePtr->setAlignment(1);
NamePtr->setComdat(ProfileVarsComdat);