librustc: Use builder for llvm attributes.
This commit is contained in:
@@ -113,6 +113,16 @@ extern "C" void LLVMAddCallSiteAttribute(LLVMValueRef Instr, unsigned index, uin
|
||||
index, B)));
|
||||
}
|
||||
|
||||
extern "C" void LLVMAddDereferenceableCallSiteAttr(LLVMValueRef Instr, unsigned idx, uint64_t b) {
|
||||
CallSite Call = CallSite(unwrap<Instruction>(Instr));
|
||||
AttrBuilder B;
|
||||
B.addDereferenceableAttr(b);
|
||||
Call.setAttributes(
|
||||
Call.getAttributes().addAttributes(Call->getContext(), idx,
|
||||
AttributeSet::get(Call->getContext(),
|
||||
idx, B)));
|
||||
}
|
||||
|
||||
extern "C" void LLVMAddFunctionAttribute(LLVMValueRef Fn, unsigned index, uint64_t Val) {
|
||||
Function *A = unwrap<Function>(Fn);
|
||||
AttrBuilder B;
|
||||
@@ -120,6 +130,13 @@ extern "C" void LLVMAddFunctionAttribute(LLVMValueRef Fn, unsigned index, uint64
|
||||
A->addAttributes(index, AttributeSet::get(A->getContext(), index, B));
|
||||
}
|
||||
|
||||
extern "C" void LLVMAddDereferenceableAttr(LLVMValueRef Fn, unsigned index, uint64_t bytes) {
|
||||
Function *A = unwrap<Function>(Fn);
|
||||
AttrBuilder B;
|
||||
B.addDereferenceableAttr(bytes);
|
||||
A->addAttributes(index, AttributeSet::get(A->getContext(), index, B));
|
||||
}
|
||||
|
||||
extern "C" void LLVMAddFunctionAttrString(LLVMValueRef Fn, unsigned index, const char *Name) {
|
||||
Function *F = unwrap<Function>(Fn);
|
||||
AttrBuilder B;
|
||||
|
||||
Reference in New Issue
Block a user