Add support for the Switch instruction by running the lowerSwitch pass first
[oota-llvm.git] / lib / Transforms / LevelRaise.cpp
index 6ea60059eae45790fd72e5cf84deed0e98c9934f..952082320635046f6a4bb87acccaecea81f43082 100644 (file)
@@ -158,7 +158,7 @@ static bool PeepholeOptimizeAddCast(BasicBlock *BB, BasicBlock::iterator &BI,
                                     Value *AddOp1, CastInst *AddOp2) {
   const CompositeType *CompTy;
   Value *OffsetVal = AddOp2->getOperand(0);
-  Value *SrcPtr;  // Of type pointer to struct...
+  Value *SrcPtr = 0;  // Of type pointer to struct...
 
   if ((CompTy = getPointedToComposite(AddOp1->getType()))) {
     SrcPtr = AddOp1;                      // Handle the first case...
@@ -209,7 +209,7 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
       if (!Src->hasName() && CI->hasName()) {
         std::string Name = CI->getName();
         CI->setName("");
-        Src->setName(Name, BB->getParent()->getSymbolTable());
+        Src->setName(Name, &BB->getParent()->getSymbolTable());
       }
 
       // DCE the instruction now, to avoid having the iterative version of DCE