From 7374a0118da11c07df617aeaa26b0f70a69603f2 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 6 May 2009 12:21:17 +0000 Subject: OCaml parameter attribute bindings from PR2752. Incomplete, but better than nothing. llvm-svn: 71081 --- llvm/lib/VMCore/Core.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'llvm/lib/VMCore/Core.cpp') 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(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(Fn); + const AttrListPtr PAL = Func->getAttributes(); + const AttrListPtr PALnew = PAL.removeAttr(0, PA); + Func->setAttributes(PALnew); +} + /*--.. Operations on parameters ............................................--*/ unsigned LLVMCountParams(LLVMValueRef FnRef) { -- cgit v1.2.3