Use new interface, simplifies code
authorChris Lattner <sabre@nondot.org>
Sun, 31 Aug 2003 00:22:27 +0000 (00:22 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 31 Aug 2003 00:22:27 +0000 (00:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8242 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LowerAllocations.cpp

index 97e2b997cf47733d49e81e2433b09ef5a17cd722..be66edf9fa584bffa3e10cb5ec4716fe27278ef8 100644 (file)
@@ -58,17 +58,9 @@ FunctionPass *createLowerAllocationsPass() {
 // 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;
 }