diff options
| author | Zachary Turner <zturner@google.com> | 2016-07-11 21:45:09 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2016-07-11 21:45:09 +0000 |
| commit | f6b93824677a9aaab59989f7f402010fda6bd63c (patch) | |
| tree | 0979c153065da358ba2de28c6b4ca02b1a6b7ae5 /llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp | |
| parent | f52c3cf27251cb1e254d9829b74c538be7adfd06 (diff) | |
| download | bcm5719-llvm-f6b93824677a9aaab59989f7f402010fda6bd63c.tar.gz bcm5719-llvm-f6b93824677a9aaab59989f7f402010fda6bd63c.zip | |
[pdb] Add a pdb2yaml option to not dump file headers.
This will be useful once we start adding the ability to dump type
records and symbol records, since it will allow us to generate
mergeable information instead of information that specifies an
entire file.
llvm-svn: 275109
Diffstat (limited to 'llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp')
| -rw-r--r-- | llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp b/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp index 32f19414dd9..f3c730fc6b3 100644 --- a/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp +++ b/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp @@ -42,20 +42,24 @@ Error YAMLOutputStyle::dump() { } Error YAMLOutputStyle::dumpFileHeaders() { + if (opts::pdb2yaml::NoFileHeaders) + return Error::success(); + yaml::MsfHeaders Headers; - Obj.Headers.SuperBlock.NumBlocks = File.getBlockCount(); - Obj.Headers.SuperBlock.BlockMapAddr = File.getBlockMapIndex(); - Obj.Headers.BlockMapOffset = File.getBlockMapOffset(); - Obj.Headers.SuperBlock.BlockSize = File.getBlockSize(); + Obj.Headers.emplace(); + Obj.Headers->SuperBlock.NumBlocks = File.getBlockCount(); + Obj.Headers->SuperBlock.BlockMapAddr = File.getBlockMapIndex(); + Obj.Headers->BlockMapOffset = File.getBlockMapOffset(); + Obj.Headers->SuperBlock.BlockSize = File.getBlockSize(); auto Blocks = File.getDirectoryBlockArray(); - Obj.Headers.DirectoryBlocks.assign(Blocks.begin(), Blocks.end()); - Obj.Headers.NumDirectoryBlocks = File.getNumDirectoryBlocks(); - Obj.Headers.SuperBlock.NumDirectoryBytes = File.getNumDirectoryBytes(); - Obj.Headers.NumStreams = + Obj.Headers->DirectoryBlocks.assign(Blocks.begin(), Blocks.end()); + Obj.Headers->NumDirectoryBlocks = File.getNumDirectoryBlocks(); + Obj.Headers->SuperBlock.NumDirectoryBytes = File.getNumDirectoryBytes(); + Obj.Headers->NumStreams = opts::pdb2yaml::StreamMetadata ? File.getNumStreams() : 0; - Obj.Headers.SuperBlock.Unknown0 = File.getUnknown0(); - Obj.Headers.SuperBlock.Unknown1 = File.getUnknown1(); - Obj.Headers.FileSize = File.getFileSize(); + Obj.Headers->SuperBlock.Unknown0 = File.getUnknown0(); + Obj.Headers->SuperBlock.Unknown1 = File.getUnknown1(); + Obj.Headers->FileSize = File.getFileSize(); return Error::success(); } |

