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,
@@ -239,10 +232,6 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(
239
232
return FnD;
240
233
}
241
234
242
- // / ParseCXXNonStaticMemberInitializer - We parsed and verified that the
243
- // / specified Declarator is a well formed C++ non-static data member
244
- // / declaration. Now lex its initializer and store its tokens for parsing
245
- // / after the class is complete.
246
235
void Parser::ParseCXXNonStaticMemberInitializer (Decl *VarD) {
247
236
assert (Tok.isOneOf (tok::l_brace, tok::equal) &&
248
237
" Current token not a '{' or '='!" );
@@ -334,8 +323,6 @@ void Parser::LateParsedPragma::ParseLexedPragmas() {
334
323
Self->ParseLexedPragma (*this );
335
324
}
336
325
337
- // / Utility to re-enter a possibly-templated scope while parsing its
338
- // / late-parsed components.
339
326
struct Parser ::ReenterTemplateScopeRAII {
340
327
Parser &P;
341
328
MultiParseScope Scopes;
@@ -350,7 +337,6 @@ struct Parser::ReenterTemplateScopeRAII {
350
337
}
351
338
};
352
339
353
- // / Utility to re-enter a class scope while parsing its late-parsed components.
354
340
struct Parser ::ReenterClassScopeRAII : ReenterTemplateScopeRAII {
355
341
ParsingClass &Class;
356
342
@@ -376,10 +362,6 @@ struct Parser::ReenterClassScopeRAII : ReenterTemplateScopeRAII {
376
362
}
377
363
};
378
364
379
- // / ParseLexedMethodDeclarations - We finished parsing the member
380
- // / specification of a top (non-nested) C++ class. Now go over the
381
- // / stack of method declarations with some parts for which parsing was
382
- // / delayed (such as default arguments) and parse them.
383
365
void Parser::ParseLexedMethodDeclarations (ParsingClass &Class) {
384
366
ReenterClassScopeRAII InClassScope (*this , Class);
385
367
@@ -584,9 +566,6 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
584
566
Actions.ActOnFinishDelayedCXXMethodDeclaration (getCurScope (), LM.Method );
585
567
}
586
568
587
- // / ParseLexedMethodDefs - We finished parsing the member specification of a top
588
- // / (non-nested) C++ class. Now go over the stack of lexed methods that were
589
- // / collected during its parsing and parse them all.
590
569
void Parser::ParseLexedMethodDefs (ParsingClass &Class) {
591
570
ReenterClassScopeRAII InClassScope (*this , Class);
592
571
@@ -665,9 +644,6 @@ void Parser::ParseLexedMethodDef(LexedMethod &LM) {
665
644
ParseFunctionStatementBody (LM.D , FnScope);
666
645
}
667
646
668
- // / ParseLexedMemberInitializers - We finished parsing the member specification
669
- // / of a top (non-nested) C++ class. Now go over the stack of lexed data member
670
- // / initializers that were collected during its parsing and parse them all.
671
647
void Parser::ParseLexedMemberInitializers (ParsingClass &Class) {
672
648
ReenterClassScopeRAII InClassScope (*this , Class);
673
649
@@ -735,16 +711,13 @@ void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
735
711
ConsumeAnyToken ();
736
712
}
737
713
738
- // / Wrapper class which calls ParseLexedAttribute, after setting up the
739
- // / scope appropriately.
740
714
void Parser::ParseLexedAttributes (ParsingClass &Class) {
741
715
ReenterClassScopeRAII InClassScope (*this , Class);
742
716
743
717
for (LateParsedDeclaration *LateD : Class.LateParsedDeclarations )
744
718
LateD->ParseLexedAttributes ();
745
719
}
746
720
747
- // / Parse all attributes in LAs, and attach them to Decl D.
748
721
void Parser::ParseLexedAttributeList (LateParsedAttrList &LAs, Decl *D,
749
722
bool EnterScope, bool OnDefinition) {
750
723
assert (LAs.parseSoon () &&
@@ -758,11 +731,6 @@ void Parser::ParseLexedAttributeList(LateParsedAttrList &LAs, Decl *D,
758
731
LAs.clear ();
759
732
}
760
733
761
- // / Finish parsing an attribute for which parsing was delayed.
762
- // / This will be called at the end of parsing a class declaration
763
- // / for each LateParsedAttribute. We consume the saved tokens and
764
- // / create an attribute with the arguments filled in. We add this
765
- // / to the Attribute list for the decl.
766
734
void Parser::ParseLexedAttribute (LateParsedAttribute &LA,
767
735
bool EnterScope, bool OnDefinition) {
768
736
// Create a fake EOF so that attribute parsing won't go off the end of the
@@ -876,12 +844,6 @@ void Parser::ParseLexedPragma(LateParsedPragma &LP) {
876
844
}
877
845
}
878
846
879
- // / ConsumeAndStoreUntil - Consume and store the token at the passed token
880
- // / container until the token 'T' is reached (which gets
881
- // / consumed/stored too, if ConsumeFinalToken).
882
- // / If StopAtSemi is true, then we will stop early at a ';' character.
883
- // / Returns true if token 'T1' or 'T2' was found.
884
- // / NOTE: This is a specialized version of Parser::SkipUntil.
885
847
bool Parser::ConsumeAndStoreUntil (tok::TokenKind T1, tok::TokenKind T2,
886
848
CachedTokens &Toks,
887
849
bool StopAtSemi, bool ConsumeFinalToken) {
@@ -964,12 +926,6 @@ bool Parser::ConsumeAndStoreUntil(tok::TokenKind T1, tok::TokenKind T2,
964
926
}
965
927
}
966
928
967
- // / Consume tokens and store them in the passed token container until
968
- // / we've passed the try keyword and constructor initializers and have consumed
969
- // / the opening brace of the function body. The opening brace will be consumed
970
- // / if and only if there was no error.
971
- // /
972
- // / \return True on error.
973
929
bool Parser::ConsumeAndStoreFunctionPrologue (CachedTokens &Toks) {
974
930
if (Tok.is (tok::kw_try)) {
975
931
Toks.push_back (Tok);
@@ -1181,8 +1137,6 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {
1181
1137
}
1182
1138
}
1183
1139
1184
- // / Consume and store tokens from the '?' to the ':' in a conditional
1185
- // / expression.
1186
1140
bool Parser::ConsumeAndStoreConditional (CachedTokens &Toks) {
1187
1141
// Consume '?'.
1188
1142
assert (Tok.is (tok::question));
@@ -1206,12 +1160,6 @@ bool Parser::ConsumeAndStoreConditional(CachedTokens &Toks) {
1206
1160
return true ;
1207
1161
}
1208
1162
1209
- // / ConsumeAndStoreInitializer - Consume and store the token at the passed token
1210
- // / container until the end of the current initializer expression (either a
1211
- // / default argument or an in-class initializer for a non-static data member).
1212
- // /
1213
- // / Returns \c true if we reached the end of something initializer-shaped,
1214
- // / \c false if we bailed out.
1215
1163
bool Parser::ConsumeAndStoreInitializer (CachedTokens &Toks,
1216
1164
CachedInitKind CIK) {
1217
1165
// We always want this function to consume at least one token if not at EOF.
0 commit comments