]> granicus.if.org Git - clang/commitdiff
Fix a couple of -Wsign-compare warnings introduced in r217556
authorJustin Bogner <mail@justinbogner.com>
Thu, 11 Sep 2014 03:37:42 +0000 (03:37 +0000)
committerJustin Bogner <mail@justinbogner.com>
Thu, 11 Sep 2014 03:37:42 +0000 (03:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217569 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ThreadSafetyTIL.cpp

index a15063631d93b7f6fc7261cc2cb9ac2379fd05c7..9374733e8a318ee1115b291547b817af11b4c53e 100644 (file)
@@ -200,7 +200,7 @@ int BasicBlock::topologicalFinalSort(SimpleArray<BasicBlock*>& Blocks, int ID) {
     ID = DominatorNode.Parent->topologicalFinalSort(Blocks, ID);
   for (auto *Pred : Predecessors)
     ID = Pred->topologicalFinalSort(Blocks, ID);
-  assert(ID < Blocks.size());
+  assert(static_cast<size_t>(ID) < Blocks.size());
   BlockID = ID++;
   Blocks[BlockID] = this;
   return ID;
@@ -314,7 +314,7 @@ void SCFG::computeNormalForm() {
 
   // Once dominators have been computed, the final sort may be performed.
   int NumBlocks = Exit->topologicalFinalSort(Blocks, 0);
-  assert(NumBlocks == Blocks.size());
+  assert(static_cast<size_t>(NumBlocks) == Blocks.size());
   (void) NumBlocks;
 
   // Renumber the instructions now that we have a final sort.
@@ -341,4 +341,3 @@ void SCFG::computeNormalForm() {
 }  // end namespace til
 }  // end namespace threadSafety
 }  // end namespace clang
-