Skip to content

refactor: dwarf expression lowering#141

Merged
swananan merged 5 commits intomainfrom
refactor/dwarf-expression-lowering
Apr 25, 2026
Merged

refactor: dwarf expression lowering#141
swananan merged 5 commits intomainfrom
refactor/dwarf-expression-lowering

Conversation

@swananan
Copy link
Copy Markdown
Owner

This refactor introduces a dedicated dwarf_expr module as the shared home for DWARF expression parsing, scanning, error policy, and consumer-specific lowering.

The goal is to stop spreading DWARF opcode parsing across parser/index/semantics code, and make each expression consumer declare its own mode and fallback behavior explicitly.

Move expression lowering and helper parsing into a top-level dwarf_expr
module. Parser, index, and objfile code now share the same gimli operation
walker.

Replace the CFI byte parser with shared operation lowering. This keeps
unsupported CFA expressions fail-closed while adding coverage for constu,
consts, and deref operations.
Move DW_OP_entry_value recovery and call-site fallback handling into
entry_value.rs. The main lowering path now delegates entry-value decisions
instead of carrying the full caller recovery chain inline.

Keep existing full-resolution and soft fallback behavior unchanged while
moving the entry-value specific tests with the implementation.
Centralize hard, fallback, and silent-false handling for DWARF
expression modes so parse error behavior is explicit at each call site.
Move caller-side target, parameter, and call-value lowering into
dwarf_expr::call_site so block indexing no longer owns DWARF op
parsing or call-site fallback behavior.
Move CFA expression lowering and storage-address discovery into the shared

dwarf_expr module so CFI and fast-parser callers no longer own expression

operation parsing details.
@swananan swananan merged commit ae30603 into main Apr 25, 2026
10 checks passed
@swananan swananan deleted the refactor/dwarf-expression-lowering branch April 25, 2026 14:22
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.

1 participant