21
21
22
22
using namespace clang ;
23
23
24
- // / Parse the optional ("message") part of a deleted-function-body.
25
24
StringLiteral *Parser::ParseCXXDeletedFunctionMessage () {
26
25
if (!Tok.is (tok::l_paren))
27
26
return nullptr ;
@@ -48,9 +47,6 @@ StringLiteral *Parser::ParseCXXDeletedFunctionMessage() {
48
47
return Message;
49
48
}
50
49
51
- // / If we've encountered '= delete' in a context where it is ill-formed, such
52
- // / as in the declaration of a non-function, also skip the ("message") part if
53
- // / it is present to avoid issuing further diagnostics.
54
50
void Parser::SkipDeletedFunctionBody () {
55
51
if (!Tok.is (tok::l_paren))
56
52
return ;
@@ -64,9 +60,6 @@ void Parser::SkipDeletedFunctionBody() {
64
60
BT.consumeClose ();
65
61
}
66
62
67
- // / ParseCXXInlineMethodDef - We parsed and verified that the specified
68
- // / Declarator is a well formed C++ inline method definition. Now lex its body
69
- // / and store its tokens for parsing after the C++ class is complete.
70
63
NamedDecl *Parser::ParseCXXInlineMethodDef (
71
64
AccessSpecifier AS, const ParsedAttributesView &AccessAttrs,
72
65
ParsingDeclarator &D, const ParsedTemplateInfo &TemplateInfo,
@@ -238,10 +231,6 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(
238
231
return FnD;
239
232
}
240
233
241
- // / ParseCXXNonStaticMemberInitializer - We parsed and verified that the
242
- // / specified Declarator is a well formed C++ non-static data member
243
- // / declaration. Now lex its initializer and store its tokens for parsing
244
- // / after the class is complete.
245
234
void Parser::ParseCXXNonStaticMemberInitializer (Decl *VarD) {
246
235
assert (Tok.isOneOf (tok::l_brace, tok::equal) &&
247
236
" Current token not a '{' or '='!" );
@@ -333,8 +322,6 @@ void Parser::LateParsedPragma::ParseLexedPragmas() {
333
322
Self->ParseLexedPragma (*this );
334
323
}
335
324
336
- // / Utility to re-enter a possibly-templated scope while parsing its
337
- // / late-parsed components.
338
325
struct Parser ::ReenterTemplateScopeRAII {
339
326
Parser &P;
340
327
MultiParseScope Scopes;
@@ -349,7 +336,6 @@ struct Parser::ReenterTemplateScopeRAII {
349
336
}
350
337
};
351
338
352
- // / Utility to re-enter a class scope while parsing its late-parsed components.
353
339
struct Parser ::ReenterClassScopeRAII : ReenterTemplateScopeRAII {
354
340
ParsingClass &Class;
355
341
@@ -375,10 +361,6 @@ struct Parser::ReenterClassScopeRAII : ReenterTemplateScopeRAII {
375
361
}
376
362
};
377
363
378
- // / ParseLexedMethodDeclarations - We finished parsing the member
379
- // / specification of a top (non-nested) C++ class. Now go over the
380
- // / stack of method declarations with some parts for which parsing was
381
- // / delayed (such as default arguments) and parse them.
382
364
void Parser::ParseLexedMethodDeclarations (ParsingClass &Class) {
383
365
ReenterClassScopeRAII InClassScope (*this , Class);
384
366
@@ -583,9 +565,6 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
583
565
Actions.ActOnFinishDelayedCXXMethodDeclaration (getCurScope (), LM.Method );
584
566
}
585
567
586
- // / ParseLexedMethodDefs - We finished parsing the member specification of a top
587
- // / (non-nested) C++ class. Now go over the stack of lexed methods that were
588
- // / collected during its parsing and parse them all.
589
568
void Parser::ParseLexedMethodDefs (ParsingClass &Class) {
590
569
ReenterClassScopeRAII InClassScope (*this , Class);
591
570
@@ -664,9 +643,6 @@ void Parser::ParseLexedMethodDef(LexedMethod &LM) {
664
643
ParseFunctionStatementBody (LM.D , FnScope);
665
644
}
666
645
667
- // / ParseLexedMemberInitializers - We finished parsing the member specification
668
- // / of a top (non-nested) C++ class. Now go over the stack of lexed data member
669
- // / initializers that were collected during its parsing and parse them all.
670
646
void Parser::ParseLexedMemberInitializers (ParsingClass &Class) {
671
647
ReenterClassScopeRAII InClassScope (*this , Class);
672
648
@@ -734,16 +710,13 @@ void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
734
710
ConsumeAnyToken ();
735
711
}
736
712
737
- // / Wrapper class which calls ParseLexedAttribute, after setting up the
738
- // / scope appropriately.
739
713
void Parser::ParseLexedAttributes (ParsingClass &Class) {
740
714
ReenterClassScopeRAII InClassScope (*this , Class);
741
715
742
716
for (LateParsedDeclaration *LateD : Class.LateParsedDeclarations )
743
717
LateD->ParseLexedAttributes ();
744
718
}
745
719
746
- // / Parse all attributes in LAs, and attach them to Decl D.
747
720
void Parser::ParseLexedAttributeList (LateParsedAttrList &LAs, Decl *D,
748
721
bool EnterScope, bool OnDefinition) {
749
722
assert (LAs.parseSoon () &&
@@ -757,11 +730,6 @@ void Parser::ParseLexedAttributeList(LateParsedAttrList &LAs, Decl *D,
757
730
LAs.clear ();
758
731
}
759
732
760
- // / Finish parsing an attribute for which parsing was delayed.
761
- // / This will be called at the end of parsing a class declaration
762
- // / for each LateParsedAttribute. We consume the saved tokens and
763
- // / create an attribute with the arguments filled in. We add this
764
- // / to the Attribute list for the decl.
765
733
void Parser::ParseLexedAttribute (LateParsedAttribute &LA,
766
734
bool EnterScope, bool OnDefinition) {
767
735
// Create a fake EOF so that attribute parsing won't go off the end of the
@@ -865,12 +833,6 @@ void Parser::ParseLexedPragma(LateParsedPragma &LP) {
865
833
}
866
834
}
867
835
868
- // / ConsumeAndStoreUntil - Consume and store the token at the passed token
869
- // / container until the token 'T' is reached (which gets
870
- // / consumed/stored too, if ConsumeFinalToken).
871
- // / If StopAtSemi is true, then we will stop early at a ';' character.
872
- // / Returns true if token 'T1' or 'T2' was found.
873
- // / NOTE: This is a specialized version of Parser::SkipUntil.
874
836
bool Parser::ConsumeAndStoreUntil (tok::TokenKind T1, tok::TokenKind T2,
875
837
CachedTokens &Toks,
876
838
bool StopAtSemi, bool ConsumeFinalToken) {
@@ -953,12 +915,6 @@ bool Parser::ConsumeAndStoreUntil(tok::TokenKind T1, tok::TokenKind T2,
953
915
}
954
916
}
955
917
956
- // / Consume tokens and store them in the passed token container until
957
- // / we've passed the try keyword and constructor initializers and have consumed
958
- // / the opening brace of the function body. The opening brace will be consumed
959
- // / if and only if there was no error.
960
- // /
961
- // / \return True on error.
962
918
bool Parser::ConsumeAndStoreFunctionPrologue (CachedTokens &Toks) {
963
919
if (Tok.is (tok::kw_try)) {
964
920
Toks.push_back (Tok);
@@ -1170,8 +1126,6 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {
1170
1126
}
1171
1127
}
1172
1128
1173
- // / Consume and store tokens from the '?' to the ':' in a conditional
1174
- // / expression.
1175
1129
bool Parser::ConsumeAndStoreConditional (CachedTokens &Toks) {
1176
1130
// Consume '?'.
1177
1131
assert (Tok.is (tok::question));
@@ -1195,12 +1149,6 @@ bool Parser::ConsumeAndStoreConditional(CachedTokens &Toks) {
1195
1149
return true ;
1196
1150
}
1197
1151
1198
- // / ConsumeAndStoreInitializer - Consume and store the token at the passed token
1199
- // / container until the end of the current initializer expression (either a
1200
- // / default argument or an in-class initializer for a non-static data member).
1201
- // /
1202
- // / Returns \c true if we reached the end of something initializer-shaped,
1203
- // / \c false if we bailed out.
1204
1152
bool Parser::ConsumeAndStoreInitializer (CachedTokens &Toks,
1205
1153
CachedInitKind CIK) {
1206
1154
// We always want this function to consume at least one token if not at EOF.
0 commit comments