diff options
author | Duncan Sands <baldrick@free.fr> | 2009-05-06 12:21:17 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-05-06 12:21:17 +0000 |
commit | 7374a0118da11c07df617aeaa26b0f70a69603f2 (patch) | |
tree | 966c3df061f9ce4f571e1d07bca87bce4b22f73c /llvm/lib/VMCore/Core.cpp | |
parent | ea8c48d5a1c14a221db5d4033de1b43e716d3490 (diff) | |
download | bcm5719-llvm-7374a0118da11c07df617aeaa26b0f70a69603f2.tar.gz bcm5719-llvm-7374a0118da11c07df617aeaa26b0f70a69603f2.zip |
OCaml parameter attribute bindings from PR2752.
Incomplete, but better than nothing.
llvm-svn: 71081
Diffstat (limited to 'llvm/lib/VMCore/Core.cpp')
-rw-r--r-- | llvm/lib/VMCore/Core.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index 962f7694927..1fa83ebd1c0 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -776,6 +776,20 @@ void LLVMSetGC(LLVMValueRef Fn, const char *GC) { F->clearGC(); } +void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) { + Function *Func = unwrap<Function>(Fn); + const AttrListPtr PAL = Func->getAttributes(); + const AttrListPtr PALnew = PAL.addAttr(0, PA); + Func->setAttributes(PALnew); +} + +void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) { + Function *Func = unwrap<Function>(Fn); + const AttrListPtr PAL = Func->getAttributes(); + const AttrListPtr PALnew = PAL.removeAttr(0, PA); + Func->setAttributes(PALnew); +} + /*--.. Operations on parameters ............................................--*/ unsigned LLVMCountParams(LLVMValueRef FnRef) { |