]> granicus.if.org Git - clang/commitdiff
USR generation: look at the typedef of an anonymous struct (if any) when trying to...
authorTed Kremenek <kremenek@apple.com>
Fri, 15 Jan 2010 23:08:25 +0000 (23:08 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 15 Jan 2010 23:08:25 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93572 91177308-0d34-0410-b5e6-96231b3b80d8

tools/CIndex/CIndexUSRs.cpp

index f9e1c23f7ae1e3a374b69399cb266f262b25c407..12157f4b1d204dbb913bce8d92ac1494964e684a 100644 (file)
@@ -129,8 +129,12 @@ void USRGenerator::VisitRecordDecl(RecordDecl *D) {
   Out << "@S^";
   // FIXME: Better support for anonymous structures. 
   const std::string &s = D->getNameAsString();
-  if (s.empty())
-    Out << "^anon";
+  if (s.empty()) {
+    if (TypedefDecl *TD = D->getTypedefForAnonDecl())
+      Out << "^anontd^" << TD->getNameAsString();    
+    else
+      Out << "^anon";
+  }
   else
     Out << s;
 }