diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-08-31 00:22:27 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-08-31 00:22:27 +0000 |
| commit | 2887328770a744bc7d009302c357ab2203592cbf (patch) | |
| tree | df59a29babc697e27bbc6e3f53cbb7bee13819ce /llvm/lib | |
| parent | 25bc3f86de5d6c0df11a865181e692a8f4e45ec7 (diff) | |
| download | bcm5719-llvm-2887328770a744bc7d009302c357ab2203592cbf.tar.gz bcm5719-llvm-2887328770a744bc7d009302c357ab2203592cbf.zip | |
Use new interface, simplifies code
llvm-svn: 8242
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LowerAllocations.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp b/llvm/lib/Transforms/Scalar/LowerAllocations.cpp index 97e2b997cf4..be66edf9fa5 100644 --- a/llvm/lib/Transforms/Scalar/LowerAllocations.cpp +++ b/llvm/lib/Transforms/Scalar/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<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; } |

