summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-07-22 15:46:37 +0000
committerZachary Turner <zturner@google.com>2016-07-22 15:46:37 +0000
commitd218c261247edb8b44132fcff3588a67494effb6 (patch)
treea0f8928f13397f9e1491638ca3a040241e96f4d1 /llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
parentb772151a17a508355ad46db63d13da1dbec32b09 (diff)
downloadbcm5719-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/llvm-pdbdump.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
index 62f215ddc8a..0600bcd952c 100644
--- a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -285,6 +285,16 @@ cl::opt<bool> PdbStream("pdb-stream",
cl::opt<bool> DbiStream("dbi-stream",
cl::desc("Dump the DBI Stream (Stream 2)"),
cl::sub(PdbToYamlSubcommand), cl::init(false));
+cl::opt<bool>
+ DbiModuleInfo("dbi-module-info",
+ cl::desc("Dump DBI Module Information (implies -dbi-stream)"),
+ cl::sub(PdbToYamlSubcommand), cl::init(false));
+
+cl::opt<bool> DbiModuleSourceFileInfo(
+ "dbi-module-source-info",
+ cl::desc(
+ "Dump DBI Module Source File Information (implies -dbi-module-info"),
+ cl::sub(PdbToYamlSubcommand), cl::init(false));
cl::list<std::string> InputFilename(cl::Positional,
cl::desc("<input PDB file>"), cl::Required,
@@ -375,6 +385,11 @@ static void yamlToPdb(StringRef Path) {
DbiBuilder.setPdbDllRbld(YamlObj.DbiStream->PdbDllRbld);
DbiBuilder.setPdbDllVersion(YamlObj.DbiStream->PdbDllVersion);
DbiBuilder.setVersionHeader(YamlObj.DbiStream->VerHeader);
+ for (const auto &MI : YamlObj.DbiStream->ModInfos) {
+ ExitOnErr(DbiBuilder.addModuleInfo(MI.Obj, MI.Mod));
+ for (auto S : MI.SourceFiles)
+ ExitOnErr(DbiBuilder.addModuleSourceFile(MI.Mod, S));
+ }
}
auto Pdb = Builder.build();
OpenPOWER on IntegriCloud