mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Use new interface, simplifies code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8242 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -58,17 +58,9 @@ FunctionPass *createLowerAllocationsPass() {
|
|||||||
// This function is always successful.
|
// This function is always successful.
|
||||||
//
|
//
|
||||||
bool LowerAllocations::doInitialization(Module &M) {
|
bool LowerAllocations::doInitialization(Module &M) {
|
||||||
const FunctionType *MallocType =
|
const Type *SBPTy = PointerType::get(Type::SByteTy);
|
||||||
FunctionType::get(PointerType::get(Type::SByteTy),
|
MallocFunc = M.getOrInsertFunction("malloc", SBPTy, Type::UIntTy, 0);
|
||||||
std::vector<const Type*>(1, Type::UIntTy), false);
|
FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, SBPTy, 0);
|
||||||
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);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user