diff --git a/llvm/bindings/go/llvm/ir.go b/llvm/bindings/go/llvm/ir.go index c5060811dd479..7bf92e60a2753 100644 --- a/llvm/bindings/go/llvm/ir.go +++ b/llvm/bindings/go/llvm/ir.go @@ -1277,7 +1277,7 @@ func (v Value) AddCallSiteAttribute(i int, a Attribute) { C.LLVMAddCallSiteAttribute(v.C, C.LLVMAttributeIndex(i), a.C) } func (v Value) SetInstrParamAlignment(i int, align int) { - C.LLVMSetInstrParamAlignment(v.C, C.unsigned(i), C.unsigned(align)) + C.LLVMSetInstrParamAlignment(v.C, C.LLVMAttributeIndex(i), C.unsigned(align)) } func (v Value) CalledValue() (rv Value) { rv.C = C.LLVMGetCalledValue(v.C) diff --git a/llvm/include/llvm-c/Core.h b/llvm/include/llvm-c/Core.h index 1a5e763cfc600..fc8736a110260 100644 --- a/llvm/include/llvm-c/Core.h +++ b/llvm/include/llvm-c/Core.h @@ -3287,7 +3287,7 @@ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC); */ unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr); -void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned Align); void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx, diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index c9b9cdc89191a..5ef4204f5bc37 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -2858,12 +2858,12 @@ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC) { static_cast(CC)); } -void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index, +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx, unsigned align) { auto *Call = unwrap(Instr); Attribute AlignAttr = Attribute::getWithAlignment(Call->getContext(), Align(align)); - Call->addAttributeAtIndex(index, AlignAttr); + Call->addAttributeAtIndex(Idx, AlignAttr); } void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,