[llvm] [LLVM-C] Move LLVMDISubrangeTypeMetadataKind to end of LLVMMetadataKind enum (PR #132268)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 20 11:29:16 PDT 2025


https://github.com/alan-j-hu updated https://github.com/llvm/llvm-project/pull/132268

>From ab80f9efaca0746c8cf49f8ed5247b9e5bdf04c1 Mon Sep 17 00:00:00 2001
From: Alan Hu <ahulambda at gmail.com>
Date: Thu, 20 Mar 2025 14:17:24 -0400
Subject: [PATCH] [LLVM-C] Move LLVMDISubrangeTypeMetadataKind to end of its
 enum

Inserting a new enum constant in the middle of the enum breaks the ABI for
that enum. Commit e298fc2 introduced this issue, which was revealed because
the OCaml binding tests failed.
---
 llvm/include/llvm-c/DebugInfo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm-c/DebugInfo.h b/llvm/include/llvm-c/DebugInfo.h
index 9d0875a4ed8d8..63f0d4c7b367d 100644
--- a/llvm/include/llvm-c/DebugInfo.h
+++ b/llvm/include/llvm-c/DebugInfo.h
@@ -172,7 +172,6 @@ enum {
   LLVMDIEnumeratorMetadataKind,
   LLVMDIBasicTypeMetadataKind,
   LLVMDIDerivedTypeMetadataKind,
-  LLVMDISubrangeTypeMetadataKind,
   LLVMDICompositeTypeMetadataKind,
   LLVMDISubroutineTypeMetadataKind,
   LLVMDIFileMetadataKind,
@@ -196,6 +195,7 @@ enum {
   LLVMDIGenericSubrangeMetadataKind,
   LLVMDIArgListMetadataKind,
   LLVMDIAssignIDMetadataKind,
+  LLVMDISubrangeTypeMetadataKind,
 };
 typedef unsigned LLVMMetadataKind;
 



More information about the llvm-commits mailing list