about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-05-24 22:11:12 +0000
committerbors <bors@rust-lang.org>2020-05-24 22:11:12 +0000
commit62da38d00d8d09dbaaa092c7b5e7ea343fdc2126 (patch)
tree2503b98a65a2aa4c53ead21374dd858178ae0096 /src/rustllvm/RustWrapper.cpp
parent46e85b4328fe18492894093c1092dfe509df4370 (diff)
parent14382c6437140bdc2ffaa66edd66f5726a88f156 (diff)
downloadrust-62da38d00d8d09dbaaa092c7b5e7ea343fdc2126.tar.gz
rust-62da38d00d8d09dbaaa092c7b5e7ea343fdc2126.zip
Auto merge of #72287 - Aaron1011:feature/min-token-collect, r=petrochenkov
Store tokens inside `ast::Expr`

This is a smaller version of #70091.

We now store captured tokens inside `ast::Expr`, which allows us to avoid some reparsing in `nt_to_tokenstream`. To try to mitigate the performance impact, we only collect tokens when we've seen an outer attribute.

This makes progress towards solving #43081. There are still many things left to do:

* Collect tokens for other AST items.
* Come up with a way to handle inner attributes (we need to be collecting tokens by the time we encounter them)
* Avoid re-parsing when a `#[cfg]` attr is used.

However, this is enough to fix spans for a simple example, which I've included as a test case.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions