feat: support DW_TAG_enumeration_type and DW_TAG_enumerator#1548
Open
feat: support DW_TAG_enumeration_type and DW_TAG_enumerator#1548
Conversation
the rest of the snapshots are not inlined yet but we want to have snapshots inlined. So you have to start somewhere
introduce two new substutions to make checking IR possible
…s on both architectures
mhasel
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the debug information generation for enumerations by representing them as proper DWARF enumeration types instead of type aliases.
Improves debug information generation for enumerations by representing them as proper DWARF enumeration types instead of type aliases.
Changes:
Before vs After:
Before: enums appeared as simple integer typedefs in debug info
!DIDerivedType(tag: DW_TAG_typedef, name: "en1", baseType: !9)
After: enums are represented as enumeration types with their variants
!DICompositeType(tag: DW_TAG_enumeration_type, name: "en1", baseType: !13, elements: !5)
!5 = !{!6, !7, !8}
!6 = !DIEnumerator(name: "a", value: 0)
!7 = !DIEnumerator(name: "b", value: 1)
!8 = !DIEnumerator(name: "c", value: 2)
This allows debuggers to display enum values by their symbolic names rather than raw integer values.