aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerAllocations.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-31 00:22:27 +0000
committerChris Lattner <sabre@nondot.org>2003-08-31 00:22:27 +0000
commit7d8a86aa59f99c0d7880806e4efdc513ef8db73d (patch)
treef40b4c1f2395c662063e5a818f4c8e24e9a98d89 /lib/Transforms/Utils/LowerAllocations.cpp
parent034636444b77c82c420c7f6d8c4014aa559b28e2 (diff)
Use new interface, simplifies code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8242 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 97e2b997cf..be66edf9fa 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<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;
}