Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit a1b86f4

Browse files
authored
[mlir][llvm] Align linkage enum order with LLVM (NFC) (#118484)
This change doesn't introduce any functional differences but aligns the implementation more closely with LLVM's representation. Previously, the code generated a lookup table to map MLIR enums to LLVM enums due to the lack of one-to-one correspondence. With this refactoring, the generated code now casts directly from one enum to another.
1 parent 4a158c3 commit a1b86f4

File tree

1 file changed

+9
-9
lines changed
  • mlir/include/mlir-c/Dialect

1 file changed

+9
-9
lines changed

mlir/include/mlir-c/Dialect/LLVM.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,17 @@ MLIR_CAPI_EXPORTED MlirAttribute mlirLLVMComdatAttrGet(MlirContext ctx,
175175
MlirLLVMComdat comdat);
176176

177177
enum MlirLLVMLinkage {
178-
MlirLLVMLinkagePrivate = 0,
179-
MlirLLVMLinkageInternal = 1,
180-
MlirLLVMLinkageAvailableExternally = 2,
181-
MlirLLVMLinkageLinkonce = 3,
178+
MlirLLVMLinkageExternal = 0,
179+
MlirLLVMLinkageAvailableExternally = 1,
180+
MlirLLVMLinkageLinkonce = 2,
181+
MlirLLVMLinkageLinkonceODR = 3,
182182
MlirLLVMLinkageWeak = 4,
183-
MlirLLVMLinkageCommon = 5,
183+
MlirLLVMLinkageWeakODR = 5,
184184
MlirLLVMLinkageAppending = 6,
185-
MlirLLVMLinkageExternWeak = 7,
186-
MlirLLVMLinkageLinkonceODR = 8,
187-
MlirLLVMLinkageWeakODR = 9,
188-
MlirLLVMLinkageExternal = 10,
185+
MlirLLVMLinkageInternal = 7,
186+
MlirLLVMLinkagePrivate = 8,
187+
MlirLLVMLinkageExternWeak = 9,
188+
MlirLLVMLinkageCommon = 10,
189189
};
190190
typedef enum MlirLLVMLinkage MlirLLVMLinkage;
191191

0 commit comments

Comments
 (0)