diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-06 06:59:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-06 06:59:53 +0000 |
commit | 7a0ab5f387722c83e19c7133b46b16988eb19e45 (patch) | |
tree | c5a806f006cff70ff734a77011ef5dfeac0619ca /lib/Parse | |
parent | 2f27477a29b6f5365ee545c1cac666cc8b95f518 (diff) |
rename MaybeParseCXXScopeSpecifier -> ParseOptionalCXXScopeSpecifier and
MaybeParseTypeSpecifier -> ParseOptionalTypeSpecifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61796 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 18 | ||||
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 6 | ||||
-rw-r--r-- | lib/Parse/ParseExprCXX.cpp | 17 | ||||
-rw-r--r-- | lib/Parse/Parser.cpp | 4 |
4 files changed, 23 insertions, 22 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 5e753a2c9e..3b65ee0ba7 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -449,7 +449,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, default: // Try to parse a type-specifier; if we found one, continue. If it's not // a type, this falls through. - if (MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec, TemplateParams)) + if (ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec, TemplateParams)) continue; DoneWithDeclSpec: @@ -660,7 +660,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, } } -/// MaybeParseTypeSpecifier - Try to parse a single type-specifier. We +/// ParseOptionalTypeSpecifier - Try to parse a single type-specifier. We /// primarily follow the C++ grammar with additions for C99 and GNU, /// which together subsume the C grammar. Note that the C++ /// type-specifier also includes the C type-qualifier (for const, @@ -702,9 +702,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, /// [GNU] typeof-specifier /// [OBJC] class-name objc-protocol-refs[opt] [TODO] /// [OBJC] typedef-name objc-protocol-refs[opt] [TODO] -bool Parser::MaybeParseTypeSpecifier(DeclSpec &DS, int& isInvalid, - const char *&PrevSpec, - TemplateParameterLists *TemplateParams) { +bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, int& isInvalid, + const char *&PrevSpec, + TemplateParameterLists *TemplateParams){ SourceLocation Loc = Tok.getLocation(); switch (Tok.getKind()) { @@ -712,7 +712,7 @@ bool Parser::MaybeParseTypeSpecifier(DeclSpec &DS, int& isInvalid, // Annotate typenames and C++ scope specifiers. If we get one, just // recurse to handle whatever we get. if (TryAnnotateTypeOrScopeToken()) - return MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec, TemplateParams); + return ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec,TemplateParams); // Otherwise, not a type specifier. return false; case tok::coloncolon: // ::foo::bar @@ -723,7 +723,7 @@ bool Parser::MaybeParseTypeSpecifier(DeclSpec &DS, int& isInvalid, // Annotate typenames and C++ scope specifiers. If we get one, just // recurse to handle whatever we get. if (TryAnnotateTypeOrScopeToken()) - return MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec, TemplateParams); + return ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec,TemplateParams); // Otherwise, not a type specifier. return false; @@ -1055,7 +1055,7 @@ void Parser::ParseEnumSpecifier(DeclSpec &DS) { Attr = ParseAttributes(); CXXScopeSpec SS; - if (getLang().CPlusPlus && MaybeParseCXXScopeSpecifier(SS)) { + if (getLang().CPlusPlus && ParseOptionalCXXScopeSpecifier(SS)) { if (Tok.isNot(tok::identifier)) { Diag(Tok, diag::err_expected_ident); if (Tok.isNot(tok::l_brace)) { @@ -1565,7 +1565,7 @@ void Parser::ParseDirectDeclarator(Declarator &D) { if (getLang().CPlusPlus) { if (D.mayHaveIdentifier()) { - bool afterCXXScope = MaybeParseCXXScopeSpecifier(D.getCXXScopeSpec()); + bool afterCXXScope = ParseOptionalCXXScopeSpecifier(D.getCXXScopeSpec()); if (afterCXXScope) { // Change the declaration context for name lookup, until this function // is exited (and the declarator has been parsed). diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 3dabf2e40e..09c5d52c34 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -167,7 +167,7 @@ Parser::DeclTy *Parser::ParseUsingDirective(unsigned Context, CXXScopeSpec SS; // Parse (optional) nested-name-specifier. - MaybeParseCXXScopeSpecifier(SS); + ParseOptionalCXXScopeSpecifier(SS); AttributeList *AttrList = 0; IdentifierInfo *NamespcName = 0; @@ -310,7 +310,7 @@ void Parser::ParseClassSpecifier(DeclSpec &DS, // Parse the (optional) nested-name-specifier. CXXScopeSpec SS; - if (getLang().CPlusPlus && MaybeParseCXXScopeSpecifier(SS)) { + if (getLang().CPlusPlus && ParseOptionalCXXScopeSpecifier(SS)) { if (Tok.isNot(tok::identifier)) Diag(Tok, diag::err_expected_ident); } @@ -458,7 +458,7 @@ Parser::BaseResult Parser::ParseBaseSpecifier(DeclTy *ClassDecl) // Parse optional '::' and optional nested-name-specifier. CXXScopeSpec SS; - MaybeParseCXXScopeSpecifier(SS); + ParseOptionalCXXScopeSpecifier(SS); // The location of the base class itself. SourceLocation BaseLoc = Tok.getLocation(); diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index f73bbca47c..88ca915714 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -17,10 +17,10 @@ #include "AstGuard.h" using namespace clang; -/// MaybeParseCXXScopeSpecifier - Parse global scope or nested-name-specifier. -/// Returns true if a nested-name-specifier was parsed from the token stream. -/// -/// Note that this routine will not parse ::new or ::delete. +/// ParseOptionalCXXScopeSpecifier - Parse global scope or +/// nested-name-specifier if present. Returns true if a nested-name-specifier +/// was parsed from the token stream. Note that this routine will not parse +/// ::new or ::delete, it will just leave them in the token stream. /// /// '::'[opt] nested-name-specifier /// '::' @@ -31,7 +31,7 @@ using namespace clang; /// nested-name-specifier identifier '::' /// nested-name-specifier 'template'[opt] simple-template-id '::' [TODO] /// -bool Parser::MaybeParseCXXScopeSpecifier(CXXScopeSpec &SS) { +bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS) { assert(getLang().CPlusPlus && "Call sites of this function should be guarded by checking for C++"); @@ -137,7 +137,7 @@ Parser::OwningExprResult Parser::ParseCXXIdExpression() { // '::' unqualified-id // CXXScopeSpec SS; - MaybeParseCXXScopeSpecifier(SS); + ParseOptionalCXXScopeSpecifier(SS); // unqualified-id: // identifier @@ -521,11 +521,12 @@ bool Parser::ParseCXXTypeSpecifierSeq(DeclSpec &DS) { int isInvalid = 0; // Parse one or more of the type specifiers. - if (!MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec)) { + if (!ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec)) { Diag(Tok, diag::err_operator_missing_type_specifier); return true; } - while (MaybeParseTypeSpecifier(DS, isInvalid, PrevSpec)) ; + + while (ParseOptionalTypeSpecifier(DS, isInvalid, PrevSpec)); return false; } diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index e06d80e06d..d9b39099e0 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -753,7 +753,7 @@ bool Parser::TryAnnotateTypeOrScopeToken() { // FIXME: Implement template-ids CXXScopeSpec SS; if (getLang().CPlusPlus) - MaybeParseCXXScopeSpecifier(SS); + ParseOptionalCXXScopeSpecifier(SS); if (Tok.is(tok::identifier)) { // Determine whether the identifier is a type name. @@ -825,7 +825,7 @@ bool Parser::TryAnnotateCXXScopeToken() { "Cannot be a type or scope token!"); CXXScopeSpec SS; - if (!MaybeParseCXXScopeSpecifier(SS)) + if (!ParseOptionalCXXScopeSpecifier(SS)) return false; // Push the current token back into the token stream (or revert it if it is |