mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03:00
Add new intrinsic LDC_never_inline.
LDC_never_inline is a complementary intrinsic to LDC_allow_inline. It tells the LLVM optimizer to never inline a function. This can be useful if inlining creates incorrect code. A possible application is core.thread.getStackTop().
This commit is contained in:
parent
8a4a2ea38e
commit
0b19b81ac9
5 changed files with 14 additions and 0 deletions
|
@ -815,6 +815,11 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
|||
}
|
||||
}
|
||||
|
||||
if (fdecl->neverInline)
|
||||
{
|
||||
fdecl->ir.irFunc->setNeverInline();
|
||||
}
|
||||
|
||||
if (fdecl->llvmInternal == LLVMglobal_crt_ctor || fdecl->llvmInternal == LLVMglobal_crt_dtor)
|
||||
{
|
||||
AppendFunctionToLLVMGlobalCtorsDtors(func, fdecl->priority, fdecl->llvmInternal == LLVMglobal_crt_ctor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue