[pdb] Check the display name for <unnamed-tag>, not the linkage name

This issue was encountered on libcmt.pdb, which has a type record that
looks like this:

  Struct (0x1094) {
    TypeLeafKind: LF_STRUCTURE (0x1505)
    MemberCount: 3
    Properties [ (0x200)
      HasUniqueName (0x200)
    ]
    FieldList: <field list> (0x1093)
    DerivedFrom: 0x0
    VShape: 0x0
    SizeOf: 4
    Name: <unnamed-tag>
    LinkageName: .?AU<unnamed-tag>@@
  }

The checks for startswith/endswith "<unnamed-tag>" should look at the
display name, not the linkage name.

llvm-svn: 274376
This commit is contained in:
Reid Kleckner 2016-07-01 18:43:29 +00:00
parent a89746907f
commit 6e96a4c64a
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ TpiStream::~TpiStream() {}
// Corresponds to `fUDTAnon`.
template <typename T> static bool isAnonymous(T &Rec) {
StringRef Name = Rec.getUniqueName();
StringRef Name = Rec.getName();
return Name == "<unnamed-tag>" || Name == "__unnamed" ||
Name.endswith("::<unnamed-tag>") || Name.endswith("::__unnamed");
}