Skip to content

windows-rdl more complete GUID parsing#4603

Open
kennykerr wants to merge 3 commits into
masterfrom
rdl-clang-iid
Open

windows-rdl more complete GUID parsing#4603
kennykerr wants to merge 3 commits into
masterfrom
rdl-clang-iid

Conversation

@kennykerr

Copy link
Copy Markdown
Collaborator

Fixes: #4584

@kennykerr kennykerr requested a review from Copilot June 17, 2026 18:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Ready to approve

The change is well-scoped, preserves prior behavior via a fallback path, and adds a targeted regression fixture for the reported macroized GUID parsing failure.

Note: this review does not count toward required approvals for merging.

Pull request overview

Improves windows-rdl’s clang-based extraction of IID_ GUIDs by handling macroized GUID initializers (e.g., the 7zip SDK pattern) via AST constant evaluation, and adds a dedicated fixture to prevent regressions.

Changes:

  • Parse IID_ GUID variable initializers via libclang AST evaluation (clang_Cursor_Evaluate) with a token-based fallback.
  • Add Cursor::evaluate_unsigned() helper to safely evaluate integer constant expressions.
  • Add a new clang fixture (iid_var_macroized) covering macro-expanded GUID initializers and expected RDL output.
File summaries
File Description
crates/libs/rdl/src/clang/mod.rs Adds AST-based GUID initializer parsing for IID_ variables with fallback to the existing token-based parser.
crates/libs/rdl/src/clang/cx.rs Introduces Cursor::evaluate_unsigned() to read evaluated integer constants from libclang.
crates/tests/libs/bindgen/data/clang/iid_var_macroized/input.h New fixture input modeling macroized GUID variable declarations (7zip-style).
crates/tests/libs/bindgen/data/clang/iid_var_macroized/expected.rdl New golden output validating correct GUID extraction from macroized initializers.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

windows-rdl: Fix parsing of IID_ variables when macros are used

2 participants