forked from OSchip/llvm-project
[InstrProf] Mark counters as used in debug correlation mode
In debug info correlation mode we do not emit the data globals so we need to explicitly mark the counter globals as used so they don't get stripped. Reviewed By: kyulee Differential Revision: https://reviews.llvm.org/D115981
This commit is contained in:
parent
59442a5460
commit
a699b2f1c0
|
@ -997,8 +997,11 @@ InstrProfiling::getOrCreateRegionCounters(InstrProfIncrementInst *Inc) {
|
|||
ConstantExpr::getBitCast(ValuesVar, Type::getInt8PtrTy(Ctx));
|
||||
}
|
||||
|
||||
if (DebugInfoCorrelate)
|
||||
if (DebugInfoCorrelate) {
|
||||
// Mark the counter variable as used so that it isn't optimized out.
|
||||
CompilerUsedVars.push_back(PD.RegionCounters);
|
||||
return PD.RegionCounters;
|
||||
}
|
||||
|
||||
// Create data variable.
|
||||
auto *IntPtrTy = M->getDataLayout().getIntPtrType(M->getContext());
|
||||
|
|
Loading…
Reference in New Issue