[incParse] Make the SytnaxParsingCache operate on the leading trivia's start

This commit is contained in:
Alex Hoppen
2018-05-04 13:58:55 -07:00
parent d9fd523897
commit 8c9e2e07ec
2 changed files with 6 additions and 10 deletions

View File

@@ -718,7 +718,7 @@ bool Parser::loadCurrentSyntaxNodeFromCache() {
unsigned LexerOffset =
SourceMgr.getLocOffsetInBuffer(Tok.getLoc(), L->getBufferID());
unsigned LeadingTriviaOffset = LexerOffset - LeadingTrivia.getTextLength();
if (auto TextLength = SyntaxContext->loadFromCache(LexerOffset)) {
if (auto TextLength = SyntaxContext->loadFromCache(LeadingTriviaOffset)) {
L->resetToOffset(LeadingTriviaOffset + TextLength);
L->lex(Tok, LeadingTrivia, TrailingTrivia);
return true;