Drop support for LLVM < 3.5

This allows to clean up the code a little.
This commit is contained in:
Martin 2015-10-30 22:11:35 +01:00
parent 8eab25f2fa
commit 60d676e2a1
57 changed files with 35 additions and 1019 deletions

View file

@ -439,29 +439,13 @@ IrFunction::IrFunction(FuncDeclaration* fd) {
}
void IrFunction::setNeverInline() {
#if LDC_LLVM_VER >= 303
assert(!func->getAttributes().hasAttribute(llvm::AttributeSet::FunctionIndex, llvm::Attribute::AlwaysInline) && "function can't be never- and always-inline at the same time");
func->addFnAttr(llvm::Attribute::NoInline);
#elif LDC_LLVM_VER == 302
assert(!func->getFnAttributes().hasAttribute(llvm::Attributes::AlwaysInline) && "function can't be never- and always-inline at the same time");
func->addFnAttr(llvm::Attributes::NoInline);
#else
assert(!func->hasFnAttr(llvm::Attribute::AlwaysInline) && "function can't be never- and always-inline at the same time");
func->addFnAttr(llvm::Attribute::NoInline);
#endif
}
void IrFunction::setAlwaysInline() {
#if LDC_LLVM_VER >= 303
assert(!func->getAttributes().hasAttribute(llvm::AttributeSet::FunctionIndex, llvm::Attribute::NoInline) && "function can't be never- and always-inline at the same time");
func->addFnAttr(llvm::Attribute::AlwaysInline);
#elif LDC_LLVM_VER == 302
assert(!func->getFnAttributes().hasAttribute(llvm::Attributes::NoInline) && "function can't be never- and always-inline at the same time");
func->addFnAttr(llvm::Attributes::AlwaysInline);
#else
assert(!func->hasFnAttr(llvm::Attribute::NoInline) && "function can't be never- and always-inline at the same time");
func->addFnAttr(llvm::Attribute::AlwaysInline);
#endif
}
llvm::AllocaInst* IrFunction::getOrCreateEhPtrSlot() {