mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +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()
|
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");
|
assert(!func->hasFnAttr(llvm::Attribute::AlwaysInline) && "function can't be never- and always-inline at the same time");
|
||||||
|
#endif
|
||||||
func->addFnAttr(llvm::Attribute::NoInline);
|
func->addFnAttr(llvm::Attribute::NoInline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IrFunction::setAlwaysInline()
|
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");
|
assert(!func->hasFnAttr(llvm::Attribute::NoInline) && "function can't be never- and always-inline at the same time");
|
||||||
|
#endif
|
||||||
func->addFnAttr(llvm::Attribute::AlwaysInline);
|
func->addFnAttr(llvm::Attribute::AlwaysInline);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue