Introduce and use SyntaxContext::outer_expn_info().

It reduces two `hygiene_data` accesses to one on some hot paths.
This commit is contained in:
Nicholas Nethercote
2019-05-27 13:52:11 +10:00
parent 828f6fdbe5
commit caea42f6c8
15 changed files with 39 additions and 30 deletions

View File

@@ -680,7 +680,7 @@ impl server::Span for Rustc<'_> {
self.sess.source_map().lookup_char_pos(span.lo()).file
}
fn parent(&mut self, span: Self::Span) -> Option<Self::Span> {
span.ctxt().outer().expn_info().map(|i| i.call_site)
span.ctxt().outer_expn_info().map(|i| i.call_site)
}
fn source(&mut self, span: Self::Span) -> Self::Span {
span.source_callsite()