mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
C API: Add LLVMAddTargetDependentFunctionAttr()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179645 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
634054947c
commit
68ee1520ce
@ -1705,6 +1705,13 @@ void LLVMSetGC(LLVMValueRef Fn, const char *Name);
|
|||||||
*/
|
*/
|
||||||
void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA);
|
void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a target-dependent attribute to a fuction
|
||||||
|
* @see llvm::AttrBuilder::addAttribute()
|
||||||
|
*/
|
||||||
|
void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A,
|
||||||
|
const char *V);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtain an attribute from a function.
|
* Obtain an attribute from a function.
|
||||||
*
|
*
|
||||||
|
@ -1443,6 +1443,17 @@ void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
|
|||||||
Func->setAttributes(PALnew);
|
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) {
|
void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
|
||||||
Function *Func = unwrap<Function>(Fn);
|
Function *Func = unwrap<Function>(Fn);
|
||||||
const AttributeSet PAL = Func->getAttributes();
|
const AttributeSet PAL = Func->getAttributes();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user