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

Chris Lattner lattner at cs.uiuc.edu
Fri Sep 13 17:30:01 PDT 2002


Changes in directory llvm/lib/Transforms/Scalar:

RaiseAllocations.cpp updated: 1.11 -> 1.12

---
Log message:


Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.



---
Diffs of the changes:

Index: llvm/lib/Transforms/Scalar/RaiseAllocations.cpp
diff -u llvm/lib/Transforms/Scalar/RaiseAllocations.cpp:1.11 llvm/lib/Transforms/Scalar/RaiseAllocations.cpp:1.12
--- llvm/lib/Transforms/Scalar/RaiseAllocations.cpp:1.11	Tue Sep 10 18:31:12 2002
+++ llvm/lib/Transforms/Scalar/RaiseAllocations.cpp	Fri Sep 13 17:28:33 2002
@@ -113,7 +113,6 @@
 
     if (CallInst *CI = dyn_cast<CallInst>(I)) {
       if (CI->getCalledValue() == MallocFunc) {      // Replace call to malloc?
-        const Type *PtrSByte = PointerType::get(Type::SByteTy);
         Value *Source = CI->getOperand(1);
         
         // If no prototype was provided for malloc, we may need to cast the
@@ -122,7 +121,7 @@
           Source = new CastInst(Source, Type::UIntTy, "MallocAmtCast", BI);
 
         std::string Name(CI->getName()); CI->setName("");
-        BI = new MallocInst(PtrSByte, Source, Name, BI);
+        BI = new MallocInst(Type::SByteTy, Source, Name, BI);
         CI->replaceAllUsesWith(BI);
         BIL.erase(I);
         Changed = true;





More information about the llvm-commits mailing list