]> granicus.if.org Git - clang/commitdiff
Improve documentation for Sema::getTypeName. Also, it's return type is
authorDouglas Gregor <dgregor@apple.com>
Wed, 4 Feb 2009 19:16:12 +0000 (19:16 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 4 Feb 2009 19:16:12 +0000 (19:16 +0000)
DeclTy*, not TypeTy*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63756 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp

index bf67b7873ff3b38baa7c0794ad232e59d1121f6c..2a860a849db52ca2c3114e29089f7bde5da6d37b 100644 (file)
@@ -135,7 +135,7 @@ public:
   /// 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 *getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
+  virtual DeclTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
                               Scope *S, const CXXScopeSpec *SS = 0) = 0;
 
   /// isCurrentClassName - Return true if the specified name is the
@@ -1348,7 +1348,7 @@ public:
 
   /// getTypeName - This looks at the IdentifierInfo::FETokenInfo field to
   /// determine whether the name is a typedef or not in this scope.
-  virtual TypeTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
+  virtual DeclTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
                               Scope *S, const CXXScopeSpec *SS);
 
   /// isCurrentClassName - Always returns false, because MinimalAction
index b27f11b77ca2d3615685cd692efc3dd6dce7c8e0..4879ac8458465f939ebd935b9ac296e6b5b07b0f 100644 (file)
@@ -282,7 +282,7 @@ public:
   //===--------------------------------------------------------------------===//
   // Symbol table / Decl tracking callbacks: SemaDecl.cpp.
   //
-  virtual TypeTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc, 
+  virtual DeclTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc, 
                               Scope *S, const CXXScopeSpec *SS);
   virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, DeclTy *LastInGroup) {
     return ActOnDeclarator(S, D, LastInGroup, false);
index 3e501f450a8094dad5b6f68c1c72ef08eaa855d8..e31f376d86414bc285b32b54a3a145e6f55d1881 100644 (file)
 
 using namespace clang;
 
-Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
+/// \brief If the identifier refers to a type name within this scope,
+/// return the declaration of that type.
+///
+/// This routine performs ordinary name lookup of the identifier II
+/// within the given scope, with optional C++ scope specifier SS, to
+/// determine whether the name refers to a type. If so, returns the
+/// declaration corresponding to that type. Otherwise, returns NULL.
+///
+/// If name lookup results in an ambiguity, this routine will complain
+/// and then return NULL.
+Sema::DeclTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
                                 Scope *S, const CXXScopeSpec *SS) {
   Decl *IIDecl = 0;
   LookupResult Result = LookupParsedName(S, SS, &II, LookupOrdinaryName, false);