diff options
author | Zachary Turner <zturner@google.com> | 2017-06-12 21:34:53 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-06-12 21:34:53 +0000 |
commit | 990d0c81587c2d9a3e2338998d551ce73e9a68ad (patch) | |
tree | 35b5f9a41c527cc5071596ec9c994b861be89a58 /llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp | |
parent | 4b027e8f89a273fdfb275a5eee20a3eea078e4ad (diff) | |
download | bcm5719-llvm-990d0c81587c2d9a3e2338998d551ce73e9a68ad.tar.gz bcm5719-llvm-990d0c81587c2d9a3e2338998d551ce73e9a68ad.zip |
[llvm-pdbdump] Don't fail on PDBs with no ID stream.
Older PDBs don't have this. Its presence is detected by using
the various "feature" flags that come at the end of the PDB
Stream. Detect this, and don't try to dump the ID stream if the
features tells us it's not present.
llvm-svn: 305235
Diffstat (limited to 'llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp b/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp index f6b6a156a76..44ab0d93aea 100644 --- a/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp +++ b/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp @@ -580,6 +580,14 @@ static void yamlToPdb(StringRef Path) { IpiBuilder.addTypeRecord(Type.RecordData, None); } + if (!Ipi.Records.empty()) { + // In theory newer PDBs always have an ID stream, but by saying that we're + // only going to *really* have an ID stream if there is at least one ID + // record, we leave open the opportunity to test older PDBs such as those + // that don't have an ID stream. + InfoBuilder.addFeature(PdbRaw_FeatureSig::VC140); + } + ExitOnErr(Builder.commit(opts::yaml2pdb::YamlPdbOutputFile)); } @@ -855,6 +863,7 @@ static void mergePdbs() { MergedIpi.ForEachRecord([&DestIpi](TypeIndex TI, ArrayRef<uint8_t> Data) { DestIpi.addTypeRecord(Data, None); }); + Builder.getInfoBuilder().addFeature(PdbRaw_FeatureSig::VC140); SmallString<64> OutFile(opts::merge::PdbOutputFile); if (OutFile.empty()) { |