]> granicus.if.org Git - clang/commitdiff
Although in C++ class name has external linkage, usually the definition of the
authorZhongxing Xu <xuzhongxing@gmail.com>
Mon, 5 Jul 2010 02:35:40 +0000 (02:35 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Mon, 5 Jul 2010 02:35:40 +0000 (02:35 +0000)
class is available in the same translation unit when it's needed. So we make
all of them invalid Entity.

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

lib/Index/Entity.cpp

index 0551ae537a9b16881c65e47014b35e3affa8c119..06e22bbd0431612d7c2be97ca82ed76edf2f8e8a 100644 (file)
@@ -46,6 +46,7 @@ public:
   Entity VisitVarDecl(VarDecl *D);
   Entity VisitFieldDecl(FieldDecl *D);
   Entity VisitFunctionDecl(FunctionDecl *D);
+  Entity VisitTypeDecl(TypeDecl *D);
 };
 
 }
@@ -130,6 +131,13 @@ Entity EntityGetter::VisitFieldDecl(FieldDecl *D) {
   return Entity();
 }
 
+Entity EntityGetter::VisitTypeDecl(TypeDecl *D) {
+  // Make TypeDecl an invalid Entity. Although in C++ class name has external
+  // linkage, usually the definition of the class is available in the same
+  // translation unit when it's needed. So we make all of them invalid Entity.
+  return Entity();
+}
+
 //===----------------------------------------------------------------------===//
 // EntityImpl Implementation
 //===----------------------------------------------------------------------===//