[cfe-commits] r107606 - /cfe/trunk/lib/Index/Entity.cpp

Zhongxing Xu xuzhongxing at gmail.com
Sun Jul 4 19:35:40 PDT 2010


Author: zhongxingxu
Date: Sun Jul  4 21:35:40 2010
New Revision: 107606

URL: http://llvm.org/viewvc/llvm-project?rev=107606&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Index/Entity.cpp

Modified: cfe/trunk/lib/Index/Entity.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/Entity.cpp?rev=107606&r1=107605&r2=107606&view=diff
==============================================================================
--- cfe/trunk/lib/Index/Entity.cpp (original)
+++ cfe/trunk/lib/Index/Entity.cpp Sun Jul  4 21:35:40 2010
@@ -46,6 +46,7 @@
   Entity VisitVarDecl(VarDecl *D);
   Entity VisitFieldDecl(FieldDecl *D);
   Entity VisitFunctionDecl(FunctionDecl *D);
+  Entity VisitTypeDecl(TypeDecl *D);
 };
 
 }
@@ -130,6 +131,13 @@
   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
 //===----------------------------------------------------------------------===//





More information about the cfe-commits mailing list