summaryrefslogtreecommitdiff
path: root/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-04-16 23:12:43 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-04-16 23:12:43 +0000
commit68ee1520ce777871353e33fcc63725439e611f4e (patch)
treea1e73a889298083042d828668e294f5235af7af9 /lib/IR/Core.cpp
parent634054947c87502e29c0610eb9b378515b768814 (diff)
downloadllvm-68ee1520ce777871353e33fcc63725439e611f4e.tar.gz
llvm-68ee1520ce777871353e33fcc63725439e611f4e.tar.bz2
llvm-68ee1520ce777871353e33fcc63725439e611f4e.tar.xz
C API: Add LLVMAddTargetDependentFunctionAttr()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Core.cpp')
-rw-r--r--lib/IR/Core.cpp11
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();