rename MaybeParseCXXScopeSpecifier -> ParseOptionalCXXScopeSpecifier and
MaybeParseTypeSpecifier -> ParseOptionalTypeSpecifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61796 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 5e753a2..3b65ee0 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -449,7 +449,7 @@
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 @@
}
}
-/// 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 @@
/// [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 @@
// 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 @@
// 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 @@
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 @@
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 3dabf2e..09c5d52 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -167,7 +167,7 @@
CXXScopeSpec SS;
// Parse (optional) nested-name-specifier.
- MaybeParseCXXScopeSpecifier(SS);
+ ParseOptionalCXXScopeSpecifier(SS);
AttributeList *AttrList = 0;
IdentifierInfo *NamespcName = 0;
@@ -310,7 +310,7 @@
// 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 @@
// 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 f73bbca..88ca915 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 @@
/// 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 @@
// '::' unqualified-id
//
CXXScopeSpec SS;
- MaybeParseCXXScopeSpecifier(SS);
+ ParseOptionalCXXScopeSpecifier(SS);
// unqualified-id:
// identifier
@@ -521,11 +521,12 @@
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 e06d80e..d9b3909 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -753,7 +753,7 @@
// 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 @@
"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