ability to inline at function callsite

closes #306
This commit is contained in:
Andrew Kelley
2017-04-13 00:13:54 -04:00
parent f043e0e85c
commit 41144a8566
11 changed files with 213 additions and 48 deletions

View File

@@ -176,10 +176,13 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
LLVMValueRef ZigLLVMBuildCall(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef *Args,
unsigned NumArgs, unsigned CC, const char *Name)
unsigned NumArgs, unsigned CC, bool always_inline, const char *Name)
{
CallInst *call_inst = CallInst::Create(unwrap(Fn), makeArrayRef(unwrap(Args), NumArgs), Name);
call_inst->setCallingConv(CC);
if (always_inline) {
call_inst->addAttribute(AttributeSet::FunctionIndex, Attribute::AlwaysInline);
}
return wrap(unwrap(B)->Insert(call_inst));
}