Skip to content

Commit 33e561a

Browse files
committed
[Syntax] Include leading/trailing trivia size to the cache ID
We have to differenciate cache IDs between: (Token l_brace (trivia space 1) (text="{")) and: (Token l_brace (text="{") (trivia space 1))
1 parent ebbc9c8 commit 33e561a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Syntax/RawSyntax.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ void RawSyntax::Profile(llvm::FoldingSetNodeID &ID, tok TokKind,
329329
OwnedString Text, ArrayRef<TriviaPiece> LeadingTrivia,
330330
ArrayRef<TriviaPiece> TrailingTrivia) {
331331
ID.AddInteger(unsigned(TokKind));
332+
ID.AddInteger(LeadingTrivia.size());
333+
ID.AddInteger(TrailingTrivia.size());
332334
switch (TokKind) {
333335
#define TOKEN_DEFAULT(NAME) case tok::NAME:
334336
#define PUNCTUATOR(NAME, X) TOKEN_DEFAULT(NAME)

0 commit comments

Comments
 (0)