about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-18 00:48:51 -0700
committerGitHub <noreply@github.com>2016-09-18 00:48:51 -0700
commitf39039e6e5ab4ff3010e2d133d12e44d1cfcb631 (patch)
tree46b4d4014fb9acf227a0c6db49b4c53310f077ec /src/rustllvm/RustWrapper.cpp
parent0b03ba1f5545ac1e8c434346de29c41aba82837e (diff)
parent8075d546069e9fc850beb846747c43e9ee55e175 (diff)
downloadrust-f39039e6e5ab4ff3010e2d133d12e44d1cfcb631.tar.gz
rust-f39039e6e5ab4ff3010e2d133d12e44d1cfcb631.zip
Auto merge of #36527 - nnethercote:last_token_kind, r=jseyfried
Optimize the parser's last token handling.

The parser currently makes a heap copy of the last token in four cases:
identifiers, paths, doc comments, and commas. The identifier and
interpolation cases are unused, and for doc comments and commas we only
need to record their presence, not their value.

This commit consolidates the last token handling and avoids the
unnecessary copies by replacing `last_token`, `last_token_eof`, and
`last_token_interpolated` with a new field `last_token_kind`. This
simplifies the parser slightly and speeds up parsing on some files by
3--4%.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions