mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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))
This commit is contained in:
@@ -329,6 +329,8 @@ void RawSyntax::Profile(llvm::FoldingSetNodeID &ID, tok TokKind,
|
||||
OwnedString Text, ArrayRef<TriviaPiece> LeadingTrivia,
|
||||
ArrayRef<TriviaPiece> TrailingTrivia) {
|
||||
ID.AddInteger(unsigned(TokKind));
|
||||
ID.AddInteger(LeadingTrivia.size());
|
||||
ID.AddInteger(TrailingTrivia.size());
|
||||
switch (TokKind) {
|
||||
#define TOKEN_DEFAULT(NAME) case tok::NAME:
|
||||
#define PUNCTUATOR(NAME, X) TOKEN_DEFAULT(NAME)
|
||||
|
||||
Reference in New Issue
Block a user