[llvm] 39e2e3b - [NFC][C API] Make LLVMSetInstrParamAlignment's index param type LLVMAttributeIndex
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 7 15:13:59 PDT 2021
Author: Arthur Eubanks
Date: 2021-09-07T15:13:45-07:00
New Revision: 39e2e3bddbf459d16b00969af1415ebee11fcbdc
URL: https://github.com/llvm/llvm-project/commit/39e2e3bddbf459d16b00969af1415ebee11fcbdc
DIFF: https://github.com/llvm/llvm-project/commit/39e2e3bddbf459d16b00969af1415ebee11fcbdc.diff
LOG: [NFC][C API] Make LLVMSetInstrParamAlignment's index param type LLVMAttributeIndex
It's the same as unsigned, but clearer in intent.
Added:
Modified:
llvm/bindings/go/llvm/ir.go
llvm/include/llvm-c/Core.h
llvm/lib/IR/Core.cpp
Removed:
################################################################################
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<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,
More information about the llvm-commits
mailing list