[cfe-commits] r93543 - /cfe/trunk/tools/CIndex/CIndexUSRs.cpp

Ted Kremenek kremenek at apple.com
Fri Jan 15 12:04:31 PST 2010


Author: kremenek
Date: Fri Jan 15 14:04:31 2010
New Revision: 93543

URL: http://llvm.org/viewvc/llvm-project?rev=93543&view=rev
Log:
Add USR generation for enums.

Modified:
    cfe/trunk/tools/CIndex/CIndexUSRs.cpp

Modified: cfe/trunk/tools/CIndex/CIndexUSRs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndexUSRs.cpp?rev=93543&r1=93542&r2=93543&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndexUSRs.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndexUSRs.cpp Fri Jan 15 14:04:31 2010
@@ -74,6 +74,7 @@
   
   void VisitBlockDecl(BlockDecl *D);
   void VisitDeclContext(DeclContext *D);
+  void VisitEnumDecl(EnumDecl *D);
   void VisitFunctionDecl(FunctionDecl *D);
   void VisitNamedDecl(NamedDecl *D);
   void VisitNamespaceDecl(NamespaceDecl *D);
@@ -96,6 +97,16 @@
     Visit(D);
 }
 
+void USRGenerator::VisitEnumDecl(EnumDecl *D) {
+  VisitDeclContext(D->getDeclContext());
+  Out << "@E^";
+  const std::string &s = D->getNameAsString();
+  if (s.empty())
+    Out << "anon";
+  else
+    Out << s;
+}
+
 void USRGenerator::VisitFunctionDecl(FunctionDecl *D) {
   VisitDeclContext(D->getDeclContext());
   Out << "@F^" << D->getNameAsString();





More information about the cfe-commits mailing list