Add support for void pointers in Opir JSON output #155
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.
Futhark crashes when parsing C headers containing LLVM block pointer types, identified when attempting to wrap Apple's libdispatch library.
https://github.com/swiftlang/swift-corelibs-libdispatch/blob/main/src/BlocksRuntime/Block.h
Attempting to parse with Futhark:
gives the error:
Error: unhandled exception: Field 'base' not found in JsonNode [KeyError]Opir output for the above:
{ "kind": "pointer", "depth": 1 }Absent
basekey (appropriately) but then later unconditionally accessesjson["base"]cause crashes.findAlias()(Line 265): Crashes extracting type aliasesaddUsings()(Line 311): Crashes tracking dependenciestoNimType()(Lines 346, 370, 382, 408): Crashes generating type definitionsPatch adds
hasKey("base")guards before accessingjson["base"]in all relevant locations:findAlias(): Return empty string (no alias to track)addUsings(): Skip dependency tracking (bare pointers have no dependencies)toNimType(): Generate opaquepointertypeDisclosure: patch partially generated by Claude Code, but thoroughly manually tested and reviewed.