diff options
| author | Zachary Turner <zturner@google.com> | 2016-07-22 15:46:37 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-07-22 15:46:37 +0000 |
| commit | d218c261247edb8b44132fcff3588a67494effb6 (patch) | |
| tree | a0f8928f13397f9e1491638ca3a040241e96f4d1 /llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp | |
| parent | b772151a17a508355ad46db63d13da1dbec32b09 (diff) | |
| download | bcm5719-llvm-d218c261247edb8b44132fcff3588a67494effb6.tar.gz bcm5719-llvm-d218c261247edb8b44132fcff3588a67494effb6.zip | |
[pdb] Round-trip module & file info to/from YAML.
This implements support for writing compiland and compiland source
file info to a binary PDB. This is tested by adding support for
dumping these fields from an existing PDB to yaml, reading them
back in, and dumping them again and verifying the values are as
expected.
llvm-svn: 276426
Diffstat (limited to 'llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp')
| -rw-r--r-- | llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp b/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp index a8b6202d5d1..745cfa7b0d1 100644 --- a/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp +++ b/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp @@ -25,6 +25,10 @@ YAMLOutputStyle::YAMLOutputStyle(PDBFile &File) : File(File), Out(outs()) {} Error YAMLOutputStyle::dump() { if (opts::pdb2yaml::StreamDirectory) opts::pdb2yaml::StreamMetadata = true; + if (opts::pdb2yaml::DbiModuleSourceFileInfo) + opts::pdb2yaml::DbiModuleInfo = true; + if (opts::pdb2yaml::DbiModuleInfo) + opts::pdb2yaml::DbiStream = true; if (auto EC = dumpFileHeaders()) return EC; @@ -133,6 +137,16 @@ Error YAMLOutputStyle::dumpDbiStream() { Obj.DbiStream->PdbDllRbld = DS.getPdbDllRbld(); Obj.DbiStream->PdbDllVersion = DS.getPdbDllVersion(); Obj.DbiStream->VerHeader = DS.getDbiVersion(); + if (opts::pdb2yaml::DbiModuleInfo) { + for (const auto &MI : DS.modules()) { + yaml::PdbDbiModuleInfo DMI; + DMI.Mod = MI.Info.getModuleName(); + DMI.Obj = MI.Info.getObjFileName(); + if (opts::pdb2yaml::DbiModuleSourceFileInfo) + DMI.SourceFiles = MI.SourceFiles; + Obj.DbiStream->ModInfos.push_back(DMI); + } + } return Error::success(); } |

