Skip to content

Commit 68b2884

Browse files
committed
Merge commit '301340ace64b' from llvm.org/main into next
Conflicts: clang/include/clang/Parse/Parser.h clang/lib/Parse/ParseDecl.cpp clang/lib/Parse/ParseObjc.cpp rdar://151317736
2 parents cfa6177 + 301340a commit 68b2884

16 files changed

+8081
-7270
lines changed

clang/include/clang/Parse/Parser.h

Lines changed: 8078 additions & 3181 deletions
Large diffs are not rendered by default.

clang/lib/Parse/ParseCXXInlineMethods.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
using namespace clang;
2323

24-
/// Parse the optional ("message") part of a deleted-function-body.
2524
StringLiteral *Parser::ParseCXXDeletedFunctionMessage() {
2625
if (!Tok.is(tok::l_paren))
2726
return nullptr;
@@ -48,9 +47,6 @@ StringLiteral *Parser::ParseCXXDeletedFunctionMessage() {
4847
return Message;
4948
}
5049

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.
5450
void Parser::SkipDeletedFunctionBody() {
5551
if (!Tok.is(tok::l_paren))
5652
return;
@@ -64,9 +60,6 @@ void Parser::SkipDeletedFunctionBody() {
6460
BT.consumeClose();
6561
}
6662

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.
7063
NamedDecl *Parser::ParseCXXInlineMethodDef(
7164
AccessSpecifier AS, const ParsedAttributesView &AccessAttrs,
7265
ParsingDeclarator &D, const ParsedTemplateInfo &TemplateInfo,
@@ -239,10 +232,6 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(
239232
return FnD;
240233
}
241234

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.
246235
void Parser::ParseCXXNonStaticMemberInitializer(Decl *VarD) {
247236
assert(Tok.isOneOf(tok::l_brace, tok::equal) &&
248237
"Current token not a '{' or '='!");
@@ -334,8 +323,6 @@ void Parser::LateParsedPragma::ParseLexedPragmas() {
334323
Self->ParseLexedPragma(*this);
335324
}
336325

337-
/// Utility to re-enter a possibly-templated scope while parsing its
338-
/// late-parsed components.
339326
struct Parser::ReenterTemplateScopeRAII {
340327
Parser &P;
341328
MultiParseScope Scopes;
@@ -350,7 +337,6 @@ struct Parser::ReenterTemplateScopeRAII {
350337
}
351338
};
352339

353-
/// Utility to re-enter a class scope while parsing its late-parsed components.
354340
struct Parser::ReenterClassScopeRAII : ReenterTemplateScopeRAII {
355341
ParsingClass &Class;
356342

@@ -376,10 +362,6 @@ struct Parser::ReenterClassScopeRAII : ReenterTemplateScopeRAII {
376362
}
377363
};
378364

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.
383365
void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) {
384366
ReenterClassScopeRAII InClassScope(*this, Class);
385367

@@ -584,9 +566,6 @@ void Parser::ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM) {
584566
Actions.ActOnFinishDelayedCXXMethodDeclaration(getCurScope(), LM.Method);
585567
}
586568

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.
590569
void Parser::ParseLexedMethodDefs(ParsingClass &Class) {
591570
ReenterClassScopeRAII InClassScope(*this, Class);
592571

@@ -665,9 +644,6 @@ void Parser::ParseLexedMethodDef(LexedMethod &LM) {
665644
ParseFunctionStatementBody(LM.D, FnScope);
666645
}
667646

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.
671647
void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
672648
ReenterClassScopeRAII InClassScope(*this, Class);
673649

@@ -735,16 +711,13 @@ void Parser::ParseLexedMemberInitializer(LateParsedMemberInitializer &MI) {
735711
ConsumeAnyToken();
736712
}
737713

738-
/// Wrapper class which calls ParseLexedAttribute, after setting up the
739-
/// scope appropriately.
740714
void Parser::ParseLexedAttributes(ParsingClass &Class) {
741715
ReenterClassScopeRAII InClassScope(*this, Class);
742716

743717
for (LateParsedDeclaration *LateD : Class.LateParsedDeclarations)
744718
LateD->ParseLexedAttributes();
745719
}
746720

747-
/// Parse all attributes in LAs, and attach them to Decl D.
748721
void Parser::ParseLexedAttributeList(LateParsedAttrList &LAs, Decl *D,
749722
bool EnterScope, bool OnDefinition) {
750723
assert(LAs.parseSoon() &&
@@ -758,11 +731,6 @@ void Parser::ParseLexedAttributeList(LateParsedAttrList &LAs, Decl *D,
758731
LAs.clear();
759732
}
760733

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.
766734
void Parser::ParseLexedAttribute(LateParsedAttribute &LA,
767735
bool EnterScope, bool OnDefinition) {
768736
// 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) {
876844
}
877845
}
878846

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.
885847
bool Parser::ConsumeAndStoreUntil(tok::TokenKind T1, tok::TokenKind T2,
886848
CachedTokens &Toks,
887849
bool StopAtSemi, bool ConsumeFinalToken) {
@@ -964,12 +926,6 @@ bool Parser::ConsumeAndStoreUntil(tok::TokenKind T1, tok::TokenKind T2,
964926
}
965927
}
966928

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.
973929
bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {
974930
if (Tok.is(tok::kw_try)) {
975931
Toks.push_back(Tok);
@@ -1181,8 +1137,6 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {
11811137
}
11821138
}
11831139

1184-
/// Consume and store tokens from the '?' to the ':' in a conditional
1185-
/// expression.
11861140
bool Parser::ConsumeAndStoreConditional(CachedTokens &Toks) {
11871141
// Consume '?'.
11881142
assert(Tok.is(tok::question));
@@ -1206,12 +1160,6 @@ bool Parser::ConsumeAndStoreConditional(CachedTokens &Toks) {
12061160
return true;
12071161
}
12081162

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.
12151163
bool Parser::ConsumeAndStoreInitializer(CachedTokens &Toks,
12161164
CachedInitKind CIK) {
12171165
// We always want this function to consume at least one token if not at EOF.

0 commit comments

Comments
 (0)