trailofbits / multiplier

Code auditing productivity multiplier.
Apache License 2.0
439 stars 27 forks source link

API to list the declarations overlapping macro expansion #552

Closed kumarak closed 5 months ago

kumarak commented 5 months ago

The changes does not include parsed_tokens API in MacroSubstitution. That will need changes in PASTA to add serialize and deserialize APIs for the offset and num_tokens. I will have them in different PR and it will follow Fragment::parsed_tokens.

pgoodman commented 5 months ago

The changes does not include parsed_tokens API in MacroSubstitution. That will need changes in PASTA to add serialize and deserialize APIs for the offset and num_tokens. I will have them in different PR and it will follow Fragment::parsed_tokens.

Offline discussions have settled on a design where parsed_tokens will just use first_fully_substituted_token and last_fully_substituted_token, thus not requiring database changes.

pgoodman commented 5 months ago

Offline discussions have settled in the design of moving Decl::overlapping(MacroSubstitution &) to TokenRange::overlapping_declarations and similarly TokenRange::overlapping_statements. This can beconst &methods. Then we can havesub.parsed_tokens().overlapping_declaratons()`.

kumarak commented 5 months ago

Update PR to implement parsed_tokens and move the overlapping & covering APIs to TokenRange. This way it will be more generic and can apply on any TokenRange.