From: Steve Naroff Date: Wed, 28 Jan 2009 19:39:02 +0000 (+0000) Subject: Name change (isTypeName->getTypeName). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b43a50ff1b0b171ece84425b0ad83a9a31f038fa;p=clang Name change (isTypeName->getTypeName). Since it doesn't return a bool, is shouldn't be prefixed with 'is'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63226 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/InternalsManual.html b/docs/InternalsManual.html index 27232843d3..f35dcc2de9 100644 --- a/docs/InternalsManual.html +++ b/docs/InternalsManual.html @@ -600,7 +600,7 @@ is. See below for the different valid kinds.
  1. tok::annot_typename: This annotation token represents a resolved typename token that is potentially qualified. The AnnotationValue -field contains a pointer returned by Action::isTypeName(). In the case of the +field contains a pointer returned by Action::getTypeName(). In the case of the Sema actions module, this is a Decl* for the type.
  2. tok::annot_cxxscope: This annotation token represents a C++ scope diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 02948bbbcf..3daf2d553e 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -54,7 +54,7 @@ namespace clang { /// the parser has just done or is about to do when the method is called. They /// are not requests that the actions module do the specified action. /// -/// All of the methods here are optional except isTypeName() and +/// All of the methods here are optional except getTypeName() and /// isCurrentClassName(), which must be specified in order for the /// parse to complete accurately. The MinimalAction class does this /// bare-minimum of tracking to implement this functionality. @@ -130,12 +130,12 @@ public: // Declaration Tracking Callbacks. //===--------------------------------------------------------------------===// - /// isTypeName - Return non-null if the specified identifier is a type name + /// getTypeName - Return non-null if the specified identifier is a type name /// in the current scope. /// An optional CXXScopeSpec can be passed to indicate the C++ scope (class or /// namespace) that the identifier must be a member of. /// i.e. for "foo::bar", 'II' will be "bar" and 'SS' will be "foo::". - virtual TypeTy *isTypeName(IdentifierInfo &II, Scope *S, + virtual TypeTy *getTypeName(IdentifierInfo &II, Scope *S, const CXXScopeSpec *SS = 0) = 0; /// isCurrentClassName - Return true if the specified name is the @@ -1326,10 +1326,10 @@ public: MinimalAction(Preprocessor &pp); ~MinimalAction(); - /// isTypeName - This looks at the IdentifierInfo::FETokenInfo field to + /// getTypeName - This looks at the IdentifierInfo::FETokenInfo field to /// determine whether the name is a typedef or not in this scope. - virtual TypeTy *isTypeName(IdentifierInfo &II, Scope *S, - const CXXScopeSpec *SS); + virtual TypeTy *getTypeName(IdentifierInfo &II, Scope *S, + const CXXScopeSpec *SS); /// isCurrentClassName - Always returns false, because MinimalAction /// does not support C++ classes with constructors. diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index cf479f000e..e2cac8dd90 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -693,7 +693,7 @@ private: return false; IdentifierInfo *II = Tok.getIdentifierInfo(); - if (Actions.isTypeName(*II, CurScope)) + if (Actions.getTypeName(*II, CurScope)) return true; return II == Ident_super; diff --git a/lib/Parse/MinimalAction.cpp b/lib/Parse/MinimalAction.cpp index 2b7b335ed4..6fd5fc0315 100644 --- a/lib/Parse/MinimalAction.cpp +++ b/lib/Parse/MinimalAction.cpp @@ -80,8 +80,8 @@ void MinimalAction::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) { /// /// FIXME: Use the passed CXXScopeSpec for accurate C++ type checking. Action::TypeTy * -MinimalAction::isTypeName(IdentifierInfo &II, Scope *S, - const CXXScopeSpec *SS) { +MinimalAction::getTypeName(IdentifierInfo &II, Scope *S, + const CXXScopeSpec *SS) { if (TypeNameInfo *TI = II.getFETokenInfo()) if (TI->isTypeName) return TI; diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index dc6768f999..eb5cedd5f4 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -484,8 +484,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, GetLookAheadToken(2).is(tok::l_paren)) goto DoneWithDeclSpec; - TypeTy *TypeRep = Actions.isTypeName(*NextToken().getIdentifierInfo(), - CurScope, &SS); + TypeTy *TypeRep = Actions.getTypeName(*NextToken().getIdentifierInfo(), + CurScope, &SS); if (TypeRep == 0) goto DoneWithDeclSpec; @@ -538,7 +538,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, goto DoneWithDeclSpec; // It has to be available as a typedef too! - TypeTy *TypeRep = Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope); + TypeTy *TypeRep = Actions.getTypeName(*Tok.getIdentifierInfo(), CurScope); if (TypeRep == 0) goto DoneWithDeclSpec; @@ -1736,8 +1736,8 @@ void Parser::ParseDirectDeclarator(Declarator &D) { // If this identifier is the name of the current class, it's a // constructor name. else if (Actions.isCurrentClassName(*Tok.getIdentifierInfo(), CurScope)) - D.setConstructor(Actions.isTypeName(*Tok.getIdentifierInfo(), - CurScope), + D.setConstructor(Actions.getTypeName(*Tok.getIdentifierInfo(), + CurScope), Tok.getLocation()); // This is a normal identifier. else @@ -1994,7 +1994,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, // K&R-style function: void foo(a,b,c) if (!getLang().CPlusPlus && Tok.is(tok::identifier)) { - TypeTy *TypeRep = Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope); + TypeTy *TypeRep = Actions.getTypeName(*Tok.getIdentifierInfo(), CurScope); if (TypeRep) { // This is a typename. Replace the current token in-place with an // annotation type token. @@ -2203,7 +2203,7 @@ void Parser::ParseFunctionDeclaratorIdentifierList(SourceLocation LParenLoc, IdentifierInfo *ParmII = Tok.getIdentifierInfo(); // Reject 'typedef int y; int test(x, y)', but continue parsing. - if (Actions.isTypeName(*ParmII, CurScope)) + if (Actions.getTypeName(*ParmII, CurScope)) Diag(Tok, diag::err_unexpected_typedef_ident) << ParmII; // Verify that the argument identifier has not already been mentioned. diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index ed4d1dffee..27b2d74c85 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -232,7 +232,7 @@ Parser::TypeTy *Parser::ParseClassName(const CXXScopeSpec *SS) { } // We have an identifier; check whether it is actually a type. - TypeTy *Type = Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope, SS); + TypeTy *Type = Actions.getTypeName(*Tok.getIdentifierInfo(), CurScope, SS); if (!Type) { Diag(Tok, diag::err_expected_class_name); return 0; diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index 0e1b22202c..33ce08ef48 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -737,7 +737,7 @@ Parser::OwningExprResult Parser::ParseSimpleAsm() { /// inside expressions to be treated as typenames so it will not be called /// for expressions in C. /// The benefit for C/ObjC is that a typename will be annotated and -/// Actions.isTypeName will not be needed to be called again (e.g. isTypeName +/// Actions.getTypeName will not be needed to be called again (e.g. getTypeName /// will not be called twice, once to check whether we have a declaration /// specifier, and another one to get the actual type inside /// ParseDeclarationSpecifiers). @@ -757,8 +757,8 @@ bool Parser::TryAnnotateTypeOrScopeToken() { if (Tok.is(tok::identifier)) { // Determine whether the identifier is a type name. - if (TypeTy *Ty = Actions.isTypeName(*Tok.getIdentifierInfo(), - CurScope, &SS)) { + if (TypeTy *Ty = Actions.getTypeName(*Tok.getIdentifierInfo(), + CurScope, &SS)) { // This is a typename. Replace the current token in-place with an // annotation type token. Tok.setKind(tok::annot_typename); diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 9206dd53c9..d017e6f9c7 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -282,8 +282,8 @@ public: //===--------------------------------------------------------------------===// // Symbol table / Decl tracking callbacks: SemaDecl.cpp. // - virtual TypeTy *isTypeName(IdentifierInfo &II, Scope *S, - const CXXScopeSpec *SS); + virtual TypeTy *getTypeName(IdentifierInfo &II, Scope *S, + const CXXScopeSpec *SS); virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup) { return ActOnDeclarator(S, D, LastInGroup, false); } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 22650f525d..cfbd288aae 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -31,8 +31,8 @@ using namespace clang; -Sema::TypeTy *Sema::isTypeName(IdentifierInfo &II, Scope *S, - const CXXScopeSpec *SS) { +Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, Scope *S, + const CXXScopeSpec *SS) { DeclContext *DC = 0; if (SS) { if (SS->isInvalid()) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 91a282dd95..0e08eb3fd8 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -692,7 +692,7 @@ Sema::ActOnMemInitializer(DeclTy *ConstructorD, } // It didn't name a member, so see if it names a class. - TypeTy *BaseTy = isTypeName(*MemberOrBase, S, 0/*SS*/); + TypeTy *BaseTy = getTypeName(*MemberOrBase, S, 0/*SS*/); if (!BaseTy) return Diag(IdLoc, diag::err_mem_init_not_member_or_class) << MemberOrBase << SourceRange(IdLoc, RParenLoc);