diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IR/Core.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index f1f7eb31bb..e769ab4e7d 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -1443,6 +1443,17 @@ void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) { Func->setAttributes(PALnew); } +void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, + const char *V) { + Function *Func = unwrap<Function>(Fn); + int Idx = AttributeSet::FunctionIndex; + AttrBuilder B; + + B.addAttribute(A, V); + AttributeSet Set = AttributeSet::get(Func->getContext(), Idx, B); + Func->addAttributes(Idx, Set); +} + void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) { Function *Func = unwrap<Function>(Fn); const AttributeSet PAL = Func->getAttributes(); |