From 5e03034654b4ece9815cc140e080f5e6b68cef5b Mon Sep 17 00:00:00 2001 From: kai Date: Sat, 29 Sep 2012 20:51:21 +0200 Subject: [PATCH] Make LDC compile with LLVM 3.2 again. --- ir/irfunction.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ir/irfunction.cpp b/ir/irfunction.cpp index d9493e80..6b56c86b 100644 --- a/ir/irfunction.cpp +++ b/ir/irfunction.cpp @@ -151,12 +151,20 @@ IrFunction::IrFunction(FuncDeclaration* fd) void IrFunction::setNeverInline() { +#if LDC_LLVM_VER >= 302 + assert(!func->getFnAttributes().hasAlwaysInlineAttr() && "function can't be never- and always-inline at the same time"); +#else assert(!func->hasFnAttr(llvm::Attribute::AlwaysInline) && "function can't be never- and always-inline at the same time"); +#endif func->addFnAttr(llvm::Attribute::NoInline); } void IrFunction::setAlwaysInline() { +#if LDC_LLVM_VER >= 302 + assert(!func->getFnAttributes().hasNoInlineAttr() && "function can't be never- and always-inline at the same time"); +#else assert(!func->hasFnAttr(llvm::Attribute::NoInline) && "function can't be never- and always-inline at the same time"); +#endif func->addFnAttr(llvm::Attribute::AlwaysInline); }