]> granicus.if.org Git - clang/commitdiff
Fixing a -Woverflow warning from GCC by using a more natural datatype for this operat...
authorAaron Ballman <aaron@aaronballman.com>
Fri, 12 Sep 2014 12:42:15 +0000 (12:42 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 12 Sep 2014 12:42:15 +0000 (12:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217670 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/Analyses/ThreadSafetyTIL.h
lib/Analysis/ThreadSafetyTIL.cpp

index da0657990a23bd5ecb2089d885818ec547b8cc2f..e06593c6905c41e1fcd9bbfcb680882ea0196bbe 100644 (file)
@@ -1669,7 +1669,7 @@ private:
   SCFG         *CFGPtr;      // The CFG that contains this block.
   int          BlockID : 31; // unique id for this BB in the containing CFG.
                              // IDs are in topological order.
-  int          Visited : 1;  // Bit to determine if a block has been visited
+  bool         Visited : 1;  // Bit to determine if a block has been visited
                              // during a traversal.
   BlockArray  Predecessors;  // Predecessor blocks in the CFG.
   InstrArray  Args;          // Phi nodes.  One argument per predecessor.
index 9374733e8a318ee1115b291547b817af11b4c53e..ebe374ea609dbbc95eb3337e99488dad937a82f7 100644 (file)
@@ -170,7 +170,7 @@ int BasicBlock::renumberInstrs(int ID) {
 // block, and ID should be the total number of blocks.
 int BasicBlock::topologicalSort(SimpleArray<BasicBlock*>& Blocks, int ID) {
   if (Visited) return ID;
-  Visited = 1;
+  Visited = true;
   for (auto *Block : successors())
     ID = Block->topologicalSort(Blocks, ID);
   // set ID and update block array in place.
@@ -195,7 +195,7 @@ int BasicBlock::topologicalFinalSort(SimpleArray<BasicBlock*>& Blocks, int ID) {
   // Visited is assumed to have been set by the topologicalSort.  This pass
   // assumes !Visited means that we've visited this node before.
   if (!Visited) return ID;
-  Visited = 0;
+  Visited = false;
   if (DominatorNode.Parent)
     ID = DominatorNode.Parent->topologicalFinalSort(Blocks, ID);
   for (auto *Pred : Predecessors)