[NFC][C API] Make LLVMSetInstrParamAlignment's index param type LLVMAttributeIndex

It's the same as unsigned, but clearer in intent.
This commit is contained in:
Arthur Eubanks 2021-09-07 15:11:44 -07:00
parent dcde8fdeeb
commit 39e2e3bddb
3 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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,

View File

@ -2858,12 +2858,12 @@ void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC) {
static_cast<CallingConv::ID>(CC));
}
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, LLVMAttributeIndex Idx,
unsigned align) {
auto *Call = unwrap<CallBase>(Instr);
Attribute AlignAttr =
Attribute::getWithAlignment(Call->getContext(), Align(align));
Call->addAttributeAtIndex(index, AlignAttr);
Call->addAttributeAtIndex(Idx, AlignAttr);
}
void LLVMAddCallSiteAttribute(LLVMValueRef C, LLVMAttributeIndex Idx,