File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ namespace swift {
87
87
class ConsumeTokenReceiver {
88
88
public:
89
89
// / This is called when a token is consumed.
90
- virtual void receive (Token Tok) {}
90
+ virtual void receive (const Token & Tok) {}
91
91
92
92
// / This is called to update the kind of a token whose start location is Loc.
93
93
virtual void registerTokenKindChange (SourceLoc Loc, tok NewKind) {};
@@ -488,9 +488,7 @@ class Parser {
488
488
std::vector<Token> delayedTokens;
489
489
DelayedTokenReceiver (ConsumeTokenReceiver *&receiver):
490
490
savedConsumer (receiver, this ) {}
491
- void receive (Token tok) override {
492
- delayedTokens.push_back (tok);
493
- }
491
+ void receive (const Token &tok) override { delayedTokens.push_back (tok); }
494
492
Optional<std::vector<Token>> finalize () override {
495
493
llvm_unreachable (" Cannot finalize a DelayedTokenReciever" );
496
494
}
Original file line number Diff line number Diff line change @@ -479,7 +479,8 @@ class TokenRecorder: public ConsumeTokenReceiver {
479
479
TokenKindChangeMap[Loc.getOpaquePointerValue ()] = NewKind;
480
480
}
481
481
482
- void receive (Token Tok) override {
482
+ void receive (const Token &TokParam) override {
483
+ Token Tok = TokParam;
483
484
// We filter out all tokens without valid location
484
485
if (Tok.getLoc ().isInvalid ())
485
486
return ;
You can’t perform that action at this time.
0 commit comments