Skip to content
Snippets Groups Projects
Commit 4b1cb4e3 authored by Bob Wilson's avatar Bob Wilson
Browse files

PGO: don't emit counter increment if no counters have been allocated.

I hit this while debugging another issue where my sources were in an
inconsistent state, so I don't have a testcase. Regardless, this check is
simpler and more direct than checking if the option is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203072 91177308-0d34-0410-b5e6-96231b3b80d8
parent 73c5236a
No related branches found
No related tags found
No related merge requests found
......@@ -772,7 +772,7 @@ void CodeGenPGO::emitCounterVariables() {
}
void CodeGenPGO::emitCounterIncrement(CGBuilderTy &Builder, unsigned Counter) {
if (!CGM.getCodeGenOpts().ProfileInstrGenerate)
if (!RegionCounters)
return;
llvm::Value *Addr =
Builder.CreateConstInBoundsGEP2_64(RegionCounters, 0, Counter);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment