[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LowerAllocations.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Aug 30 19:23:01 PDT 2003
Changes in directory llvm/lib/Transforms/Scalar:
LowerAllocations.cpp updated: 1.39 -> 1.40
---
Log message:
Use new interface, simplifies code
---
Diffs of the changes:
Index: llvm/lib/Transforms/Scalar/LowerAllocations.cpp
diff -u llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.39 llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.40
--- llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.39 Thu Aug 21 17:12:22 2003
+++ llvm/lib/Transforms/Scalar/LowerAllocations.cpp Sat Aug 30 19:22:27 2003
@@ -58,17 +58,9 @@
// This function is always successful.
//
bool LowerAllocations::doInitialization(Module &M) {
- const FunctionType *MallocType =
- FunctionType::get(PointerType::get(Type::SByteTy),
- std::vector<const Type*>(1, Type::UIntTy), false);
- const FunctionType *FreeType =
- FunctionType::get(Type::VoidTy,
- std::vector<const Type*>(1,
- PointerType::get(Type::SByteTy)),
- false);
-
- MallocFunc = M.getOrInsertFunction("malloc", MallocType);
- FreeFunc = M.getOrInsertFunction("free" , FreeType);
+ const Type *SBPTy = PointerType::get(Type::SByteTy);
+ MallocFunc = M.getOrInsertFunction("malloc", SBPTy, Type::UIntTy, 0);
+ FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, 0);
return true;
}
More information about the llvm-commits
mailing list