Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #61155

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e349f8f
Use a PathBuf instead of String for representing the pgo-use path int…
michaelwoerister May 22, 2019
01a59a3
PGO: Check that pgo-use file actually exists. LLVM seems to only emit…
michaelwoerister May 22, 2019
b1f27fa
rustbuild: Also build compiler-rt when building LLDB. This allows cla…
michaelwoerister May 22, 2019
51463d0
Add a smoketest for combining PGO with xLTO.
michaelwoerister May 20, 2019
b3c5cdd
Fix unit test after pgo-use change.
michaelwoerister May 22, 2019
1a35a1c
Ship profiler with windows-gnu
mati865 May 23, 2019
45e9d8e
Avoid interning in `resolve_place_op`.
nnethercote May 22, 2019
f9c4a90
Avoid unnecessary internings.
nnethercote May 22, 2019
2fab5d6
Pass symbols to `ExtCtxt::std_path` instead of strings.
nnethercote May 22, 2019
c040b3b
Pre-intern "0", "1", ..., "9", and use where appropriate.
nnethercote May 22, 2019
eb962c2
Add `ty_to_symbol` methods.
nnethercote May 23, 2019
babd1a1
Avoid some re-interning in `to_lit_token`.
nnethercote May 23, 2019
54c8725
Use `Symbol` equality in `is_ident_named`.
nnethercote May 23, 2019
c389116
Use `Symbol` equality in `check_ident_token`.
nnethercote May 23, 2019
71920d3
Use `Symbol` equality in `may_begin_with` and `parse_nt`.
nnethercote May 23, 2019
e396f99
Don't arena-allocate static symbols.
nnethercote May 23, 2019
fd19989
Fix spelling in release notes
aristocles-deploy May 25, 2019
ad0d136
Rollup merge of #61035 - nnethercote:avoid-more-symbol-interning, r=p…
Centril May 25, 2019
04f81f2
Rollup merge of #61036 - michaelwoerister:pgo-xlto-test, r=alexcrichton
Centril May 25, 2019
bc235ee
Rollup merge of #61077 - nnethercote:tweak-prefill, r=petrochenkov
Centril May 25, 2019
e6eaff6
Rollup merge of #61080 - mati865:mingw_pgo, r=sanxiyn
Centril May 25, 2019
5c60c50
Rollup merge of #61149 - vishalsodani:master, r=Centril
Centril May 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid some re-interning in to_lit_token.
  • Loading branch information
nnethercote committed May 24, 2019
commit babd1a16bb697563a554851c77699eb745e3e831
13 changes: 8 additions & 5 deletions src/libsyntax/parse/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@ impl LitKind {
/// by an AST-based macro) or unavailable (e.g. from HIR pretty-printing).
pub fn to_lit_token(&self) -> token::Lit {
let (kind, symbol, suffix) = match *self {
LitKind::Str(string, ast::StrStyle::Cooked) => {
let escaped = string.as_str().escape_default().to_string();
(token::Str, Symbol::intern(&escaped), None)
LitKind::Str(symbol, ast::StrStyle::Cooked) => {
// Don't re-intern unless the escaped string is different.
let s = &symbol.as_str();
let escaped = s.escape_default().to_string();
let symbol = if escaped == *s { symbol } else { Symbol::intern(&escaped) };
(token::Str, symbol, None)
}
LitKind::Str(string, ast::StrStyle::Raw(n)) => {
(token::StrRaw(n), string, None)
LitKind::Str(symbol, ast::StrStyle::Raw(n)) => {
(token::StrRaw(n), symbol, None)
}
LitKind::ByteStr(ref bytes) => {
let string = bytes.iter().cloned().flat_map(ascii::escape_default)
Expand Down