From 7d8a86aa59f99c0d7880806e4efdc513ef8db73d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 31 Aug 2003 00:22:27 +0000 Subject: [PATCH] Use new interface, simplifies code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8242 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LowerAllocations.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 97e2b997cf4..be66edf9fa5 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -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(1, Type::UIntTy), false); - const FunctionType *FreeType = - FunctionType::get(Type::VoidTy, - std::vector(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; } -- 2.34.1