[llvm-commits] CVS: llvm/lib/Transforms/ExprTypeConvert.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Sep 10 17:39:01 PDT 2002


Changes in directory llvm/lib/Transforms:

ExprTypeConvert.cpp updated: 1.54 -> 1.55

---
Log message:

Clean up code


---
Diffs of the changes:

Index: llvm/lib/Transforms/ExprTypeConvert.cpp
diff -u llvm/lib/Transforms/ExprTypeConvert.cpp:1.54 llvm/lib/Transforms/ExprTypeConvert.cpp:1.55
--- llvm/lib/Transforms/ExprTypeConvert.cpp:1.54	Tue Sep 10 14:42:53 2002
+++ llvm/lib/Transforms/ExprTypeConvert.cpp	Tue Sep 10 17:38:06 2002
@@ -124,10 +124,8 @@
                                       Expr.Var->getName()+"-off", It);
   }
 
-  Instruction *NewI = new MallocInst(AllocTy, Expr.Var, Name);
-
   assert(AllocTy == Ty);
-  return NewI;
+  return = new MallocInst(AllocTy, Expr.Var, Name);
 }
 
 
@@ -340,7 +338,6 @@
 
 
   BasicBlock *BB = I->getParent();
-  BasicBlock::InstListType &BIL = BB->getInstList();
   std::string Name = I->getName();  if (!Name.empty()) I->setName("");
   Instruction *Res;     // Result of conversion
 
@@ -495,7 +492,7 @@
 
   assert(Res->getType() == Ty && "Didn't convert expr to correct type!");
 
-  BIL.insert(I, Res);
+  BB->getInstList().insert(I, Res);
 
   // Add the instruction to the expression map
   VMC.ExprMap[I] = Res;
@@ -871,7 +868,6 @@
 
   BasicBlock *BB = I->getParent();
   assert(BB != 0 && "Instruction not embedded in basic block!");
-  BasicBlock::InstListType &BIL = BB->getInstList();
   std::string Name = I->getName();
   I->setName("");
   Instruction *Res;     // Result of conversion
@@ -1159,8 +1155,8 @@
   // stream.
   //
   BasicBlock::iterator It = I;
-  assert(It != BIL.end() && "Instruction not in own basic block??");
-  BIL.insert(It, Res);   // Keep It pointing to old instruction
+  assert(It != BB->end() && "Instruction not in own basic block??");
+  BB->getInstList().insert(It, Res);   // Keep It pointing to old instruction
 
   DEBUG(cerr << "COT CREATED: "  << (void*)Res << " " << Res
              << "In: " << (void*)I << " " << I << "Out: " << (void*)Res





More information about the llvm-commits mailing list