[llvm-branch-commits] [llvm] 50dd1db - [IPO] Fix operator precedence warning. NFCI.

Simon Pilgrim via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 7 10:28:27 PST 2020


Author: Simon Pilgrim
Date: 2020-12-07T18:23:54Z
New Revision: 50dd1dba6eb3a47b715cad68f92cd9bb41bb9163

URL: https://github.com/llvm/llvm-project/commit/50dd1dba6eb3a47b715cad68f92cd9bb41bb9163
DIFF: https://github.com/llvm/llvm-project/commit/50dd1dba6eb3a47b715cad68f92cd9bb41bb9163.diff

LOG: [IPO] Fix operator precedence warning. NFCI.

Check the entire assertion condition before && with the message.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/SampleContextTracker.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
index 47dd84ca73bf..37fc27e91100 100644
--- a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
+++ b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
@@ -271,7 +271,7 @@ FunctionSamples *SampleContextTracker::getBaseSamplesFor(StringRef Name,
         continue;
 
       ContextTrieNode &ToNode = promoteMergeContextSamplesTree(*FromNode);
-      assert(!Node || Node == &ToNode && "Expect only one base profile");
+      assert((!Node || Node == &ToNode) && "Expect only one base profile");
       Node = &ToNode;
     }
   }


        


More information about the llvm-branch-commits mailing list