From: Ted Kremenek Date: Fri, 15 Jan 2010 23:08:25 +0000 (+0000) Subject: USR generation: look at the typedef of an anonymous struct (if any) when trying to... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a659fb9166d2a815945824c501ce3dea4cd9d36;p=clang USR generation: look at the typedef of an anonymous struct (if any) when trying to generate a USR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93572 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/CIndex/CIndexUSRs.cpp b/tools/CIndex/CIndexUSRs.cpp index f9e1c23f7a..12157f4b1d 100644 --- a/tools/CIndex/CIndexUSRs.cpp +++ b/tools/CIndex/CIndexUSRs.cpp @@ -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; }