summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2014-03-06 04:55:28 +0000
committerBob Wilson <bob.wilson@apple.com>2014-03-06 04:55:28 +0000
commit749ebc7f33de3ea3f3212daa3bdcd958b1ca0ff6 (patch)
tree8bfde667a6aa02a63fbd236f74ddd703930f5663 /clang/lib/CodeGen
parent3c57aa4111289fb51026dae96739aaa3d20c7d3c (diff)
downloadbcm5719-llvm-749ebc7f33de3ea3f3212daa3bdcd958b1ca0ff6.tar.gz
bcm5719-llvm-749ebc7f33de3ea3f3212daa3bdcd958b1ca0ff6.zip
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. llvm-svn: 203072
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index ec53fdb0225..38bb4c00aa3 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -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);
OpenPOWER on IntegriCloud