diff options
author | Faisal Vali <faisalv@yahoo.com> | 2020-11-10 23:40:12 -0600 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2020-11-10 23:40:12 -0600 |
commit | e4d27932a59fb61aaba3ff7a3ccd1b5bc9215fb9 (patch) | |
tree | 9ff3962d42df521a9950a4689231ea9cda61f11f /clang/lib/Parse/Parser.cpp | |
parent | b8a8ef32762bfe02b10495595e578002b29c8dc8 (diff) | |
download | llvm-e4d27932a59fb61aaba3ff7a3ccd1b5bc9215fb9.zip llvm-e4d27932a59fb61aaba3ff7a3ccd1b5bc9215fb9.tar.gz llvm-e4d27932a59fb61aaba3ff7a3ccd1b5bc9215fb9.tar.bz2 |
[NFC, Refactor] Rename the (scoped) enum DeclaratorContext's enumerators to remove duplication
Since these are scoped enumerators, they have to be prefixed by DeclaratorContext, so lets remove Context from the name, and return some characters to the multiverse.
Patch was reviewed here: https://reviews.llvm.org/D91011
Thank you to aaron, bruno, wyatt and barry for indulging me.
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 109f244..825e004 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -901,7 +901,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs, // A function definition cannot start with any of these keywords. { SourceLocation DeclEnd; - return ParseDeclaration(DeclaratorContext::FileContext, DeclEnd, attrs); + return ParseDeclaration(DeclaratorContext::File, DeclEnd, attrs); } case tok::kw_static: @@ -911,7 +911,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs, Diag(ConsumeToken(), diag::warn_static_inline_explicit_inst_ignored) << 0; SourceLocation DeclEnd; - return ParseDeclaration(DeclaratorContext::FileContext, DeclEnd, attrs); + return ParseDeclaration(DeclaratorContext::File, DeclEnd, attrs); } goto dont_know; @@ -922,7 +922,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs, // Inline namespaces. Allowed as an extension even in C++03. if (NextKind == tok::kw_namespace) { SourceLocation DeclEnd; - return ParseDeclaration(DeclaratorContext::FileContext, DeclEnd, attrs); + return ParseDeclaration(DeclaratorContext::File, DeclEnd, attrs); } // Parse (then ignore) 'inline' prior to a template instantiation. This is @@ -931,7 +931,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs, Diag(ConsumeToken(), diag::warn_static_inline_explicit_inst_ignored) << 1; SourceLocation DeclEnd; - return ParseDeclaration(DeclaratorContext::FileContext, DeclEnd, attrs); + return ParseDeclaration(DeclaratorContext::File, DeclEnd, attrs); } } goto dont_know; @@ -945,9 +945,8 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs, diag::warn_cxx98_compat_extern_template : diag::ext_extern_template) << SourceRange(ExternLoc, TemplateLoc); SourceLocation DeclEnd; - return Actions.ConvertDeclToDeclGroup( - ParseExplicitInstantiation(DeclaratorContext::FileContext, ExternLoc, - TemplateLoc, DeclEnd, attrs)); + return Actions.ConvertDeclToDeclGroup(ParseExplicitInstantiation( + DeclaratorContext::File, ExternLoc, TemplateLoc, DeclEnd, attrs)); } goto dont_know; @@ -1128,11 +1127,11 @@ Parser::ParseDeclOrFunctionDefInternal(ParsedAttributesWithRange &attrs, if (getLangOpts().CPlusPlus && isTokenStringLiteral() && DS.getStorageClassSpec() == DeclSpec::SCS_extern && DS.getParsedSpecifiers() == DeclSpec::PQ_StorageClassSpecifier) { - Decl *TheDecl = ParseLinkage(DS, DeclaratorContext::FileContext); + Decl *TheDecl = ParseLinkage(DS, DeclaratorContext::File); return Actions.ConvertDeclToDeclGroup(TheDecl); } - return ParseDeclGroup(DS, DeclaratorContext::FileContext); + return ParseDeclGroup(DS, DeclaratorContext::File); } Parser::DeclGroupPtrTy @@ -1441,7 +1440,7 @@ void Parser::ParseKNRParamDeclarations(Declarator &D) { } // Parse the first declarator attached to this declspec. - Declarator ParmDeclarator(DS, DeclaratorContext::KNRTypeListContext); + Declarator ParmDeclarator(DS, DeclaratorContext::KNRTypeList); ParseDeclarator(ParmDeclarator); // Handle the full declarator list. |