Constants are now global unique objects
authorChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:42:26 +0000 (16:42 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:42:26 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@454 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InductionVars.cpp

index 42397e0a3a1cf21efbed47286b663bc6a21f07c1..b78eab8ad2eac47b97e569df80a35ccc316bc4bd 100644 (file)
@@ -191,8 +191,8 @@ static PHINode *InjectSimpleInductionVariable(cfg::Interval *Int) {
 
   // Create the neccesary instructions...
   PHINode        *PN      = new PHINode(Type::UIntTy, PHIName);
-  ConstPoolVal   *One     = new ConstPoolUInt(Type::UIntTy, 1);
-  ConstPoolVal   *Zero    = new ConstPoolUInt(Type::UIntTy, 0);
+  ConstPoolVal   *One     = ConstPoolUInt::get(Type::UIntTy, 1);
+  ConstPoolVal   *Zero    = ConstPoolUInt::get(Type::UIntTy, 0);
   BinaryOperator *AddNode = BinaryOperator::create(Instruction::Add, 
                                                   PN, One, AddName);
 
@@ -228,10 +228,6 @@ static PHINode *InjectSimpleInductionVariable(cfg::Interval *Int) {
   BasicBlock::iterator I = IL.begin();
   while ((*I)->isPHINode()) ++I;
   IL.insert(I, AddNode);
-
-  // Insert the constants into the constant pool for the method...
-  M->getConstantPool().insert(One);
-  M->getConstantPool().insert(Zero);
   return PN;
 }