llvm.org GIT mirror llvm / 7d8a86a
Use new interface, simplifies code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8242 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
1 changed file(s) with 3 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
5757 // This function is always successful.
5858 //
5959 bool LowerAllocations::doInitialization(Module &M) {
60 const FunctionType *MallocType =
61 FunctionType::get(PointerType::get(Type::SByteTy),
62 std::vector(1, Type::UIntTy), false);
63 const FunctionType *FreeType =
64 FunctionType::get(Type::VoidTy,
65 std::vector(1,
66 PointerType::get(Type::SByteTy)),
67 false);
68
69 MallocFunc = M.getOrInsertFunction("malloc", MallocType);
70 FreeFunc = M.getOrInsertFunction("free" , FreeType);
60 const Type *SBPTy = PointerType::get(Type::SByteTy);
61 MallocFunc = M.getOrInsertFunction("malloc", SBPTy, Type::UIntTy, 0);
62 FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, 0);
7163
7264 return true;
7365 }