make instnamer name unnamed blocks as well as instructions and args.
authorChris Lattner <sabre@nondot.org>
Thu, 18 Dec 2008 00:33:11 +0000 (00:33 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 18 Dec 2008 00:33:11 +0000 (00:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61175 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InstructionNamer.cpp

index e6a94e3007d2e33dc1d92cc2a1f923ec04c00c8f..4f8a1603948a6465e147c3c32ebe82b898140f8c 100644 (file)
@@ -35,10 +35,14 @@ namespace {
         if (!AI->hasName() && AI->getType() != Type::VoidTy)
           AI->setName("tmp");
 
-       for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
+      for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
+        if (!BB->hasName())
+          BB->setName("BB");
+        
         for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
           if (!I->hasName() && I->getType() != Type::VoidTy)
             I->setName("tmp");
+      }
       return true;
     }
   };