macOS compile fixes and support for slightly older versions of LLVM (to allow Mac users to brew install llvm)

This commit is contained in:
Magnus Norddahl 2016-10-17 00:19:07 +02:00
commit d654301bc2
14 changed files with 55 additions and 669 deletions

View file

@ -41,12 +41,12 @@ llvm::Function *SSAScope::intrinsic(llvm::Intrinsic::ID id, llvm::ArrayRef<llvm:
return func;
}
llvm::Value *SSAScope::alloca(llvm::Type *type)
llvm::Value *SSAScope::alloc_stack(llvm::Type *type)
{
return alloca(type, SSAInt(1));
return alloc_stack(type, SSAInt(1));
}
llvm::Value *SSAScope::alloca(llvm::Type *type, SSAInt size)
llvm::Value *SSAScope::alloc_stack(llvm::Type *type, SSAInt size)
{
// Allocas must be created at top of entry block for the PromoteMemoryToRegisterPass to work
llvm::BasicBlock &entry = SSAScope::builder().GetInsertBlock()->getParent()->getEntryBlock();