USR generation: look at the typedef of an anonymous struct (if any) when trying to generate a USR.

llvm-svn: 93572
This commit is contained in:
Ted Kremenek 2010-01-15 23:08:25 +00:00
parent 1ec62347e5
commit a7f7b17bc7
1 changed files with 6 additions and 2 deletions

View 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;
}