[compiler-rt] r270762 - [profile] Don't return `Node` when it is null.

Sean Silva via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 14:08:39 PDT 2016


Author: silvas
Date: Wed May 25 16:08:38 2016
New Revision: 270762

URL: http://llvm.org/viewvc/llvm-project?rev=270762&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingValue.c

Modified: compiler-rt/trunk/lib/profile/InstrProfilingValue.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingValue.c?rev=270762&r1=270761&r2=270762&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingValue.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingValue.c Wed May 25 16:08:38 2016
@@ -104,11 +104,13 @@ static ValueProfNode *allocateOneNode(__
     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;




More information about the llvm-commits mailing list