summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Silva <chisophugis@gmail.com>2016-05-25 21:08:38 +0000
committerSean Silva <chisophugis@gmail.com>2016-05-25 21:08:38 +0000
commit5cf73b09cd47290024ddcd9ecdead99e81d62b5d (patch)
treee1131b5d8bc6aa7a9c5326f5b60d315b05baca70
parent1bed207f88b43c64d754f731a393059d8aab3420 (diff)
downloadbcm5719-llvm-5cf73b09cd47290024ddcd9ecdead99e81d62b5d.tar.gz
bcm5719-llvm-5cf73b09cd47290024ddcd9ecdead99e81d62b5d.zip
[profile] Don't return `Node` when it is null.
The max warning check was masking the "return 0" codepath. See the thread "Warnings and compile-time failure on 458.sjeng" for more info. llvm-svn: 270762
-rw-r--r--compiler-rt/lib/profile/InstrProfilingValue.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler-rt/lib/profile/InstrProfilingValue.c b/compiler-rt/lib/profile/InstrProfilingValue.c
index 23690c991de..08f91b35fd5 100644
--- a/compiler-rt/lib/profile/InstrProfilingValue.c
+++ b/compiler-rt/lib/profile/InstrProfilingValue.c
@@ -104,11 +104,13 @@ static ValueProfNode *allocateOneNode(__llvm_profile_data *Data, uint32_t Index,
return (ValueProfNode *)calloc(1, sizeof(ValueProfNode));
Node = COMPILER_RT_PTR_FETCH_ADD(ValueProfNode, CurrentVNode, 1);
- if (Node >= EndVNode && (OutOfNodesWarnings ++ < MAX_VP_WARNS)) {
- PROF_WARN("Unable to track new values: %s. "
- " Consider using option -mllvm -vp-counters-per-site=<n> to allocate more"
- " value profile counters at compile time. \n",
- "Running out of static counters");
+ if (Node >= EndVNode) {
+ if (OutOfNodesWarnings++ < MAX_VP_WARNS) {
+ PROF_WARN("Unable to track new values: %s. "
+ " Consider using option -mllvm -vp-counters-per-site=<n> to allocate more"
+ " value profile counters at compile time. \n",
+ "Running out of static counters");
+ }
return 0;
}
return Node;
OpenPOWER on IntegriCloud