Use builder to create alignment attributes. Remove dead function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165890 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2012-10-14 03:58:29 +00:00
parent db55fc9dd8
commit da3f9d8edc
4 changed files with 22 additions and 26 deletions
+6 -5
View File
@@ -1474,8 +1474,9 @@ LLVMAttribute LLVMGetAttribute(LLVMValueRef Arg) {
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align) {
unwrap<Argument>(Arg)->addAttr(
Attributes::constructAlignmentFromInt(align));
Attributes::Builder B;
B.addAlignmentAttr(align);
unwrap<Argument>(Arg)->addAttr(Attributes::get(B));
}
/*--.. Operations on basic blocks ..........................................--*/
@@ -1678,9 +1679,9 @@ void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index,
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
unsigned align) {
CallSite Call = CallSite(unwrap<Instruction>(Instr));
Call.setAttributes(
Call.getAttributes().addAttr(index,
Attributes::constructAlignmentFromInt(align)));
Attributes::Builder B;
B.addAlignmentAttr(align);
Call.setAttributes(Call.getAttributes().addAttr(index, Attributes::get(B)));
}
/*--.. Operations on call instructions (only) ..............................--*/