diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-04 16:54:04 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-04 16:54:04 +0100 |
commit | e1ea2500fcc5e136fbe6a14c488f558e28519c45 (patch) | |
tree | 1cbcefd57c0dd75cd1c834e34dd00f9f89e9dd17 /crates/ra_prof | |
parent | fcdb387f0d7e76f325a858e4463efd5d7ed3efc3 (diff) | |
parent | bcf45371ff19882e67300cc483b481450ee129fb (diff) |
Merge #1238
1238: Macro queries r=edwin0cheng a=matklad
In https://github.com/rust-analyzer/rust-analyzer/pull/1231, I've added aggressive clean up of `ast_id_to_node` query.
The result of this query is a `SyntaxTree`, and we don't want to retain syntax trees in memory unless absolutely necessary.
Moreover, `SyntaxTree` has identity equality semantics, meaning that we'll get a diffferent syntax tree for a file after every reparse. That means that `ast_id_to_node` query should not genereally be used in HIR, unless it is behind some kind of salsa firewall, like the `raw` module of name resoulution.
However, that PR resulted in the abysmal performance: turns out we were using ast_id_to_node quite heavily in hir when expanding macros!
So this PR installs the more incremental-friendly query structure:
* converting source to token tree is now a query; changing source without affecting token-trees will now preserve macro expansions
* expand macro (tt -> tt) is now a query as well, so we cache macro expansions *before* parsing them into item lists or expressions, which is nice: we can cache expansion without knowing the calling context!
r? @edwin0cheng
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_prof')
0 files changed, 0 insertions, 0 deletions