mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Make LDC compile with LLVM 3.2 again.
This commit is contained in:
parent
3eea8de2cf
commit
5e03034654
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue