diff options
author | Zachary Turner <zturner@google.com> | 2017-05-02 16:56:09 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-05-02 16:56:09 +0000 |
commit | edef14510e36f307dff256faf030abbfb27be674 (patch) | |
tree | 5fd726720d7bd48b7b9059d2ac99826ffffb1580 /llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp | |
parent | bb34f278a2e12f8af526b34725fd2b61c5c8c189 (diff) | |
download | bcm5719-llvm-edef14510e36f307dff256faf030abbfb27be674.tar.gz bcm5719-llvm-edef14510e36f307dff256faf030abbfb27be674.zip |
[PDB/CodeView] Read/write codeview inlinee line information.
Previously we wrote line information and file checksum
information, but we did not write information about inlinee
lines and functions. This patch adds support for that.
llvm-svn: 301936
Diffstat (limited to 'llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp b/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp index 18596a68a3c..807d7f8b82e 100644 --- a/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp +++ b/llvm/tools/llvm-pdbdump/YAMLOutputStyle.cpp @@ -17,6 +17,7 @@ #include "llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h" #include "llvm/DebugInfo/CodeView/ModuleDebugFragment.h" #include "llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h" +#include "llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h" #include "llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h" #include "llvm/DebugInfo/CodeView/ModuleDebugUnknownFragment.h" #include "llvm/DebugInfo/MSF/MappedBlockStream.h" @@ -150,6 +151,35 @@ public: return Error::success(); } + Error handleInlineeLines() override { + for (const auto &ILF : InlineeLines) { + Info.Inlinees.emplace_back(); + auto &Inlinee = Info.Inlinees.back(); + + Inlinee.HasExtraFiles = ILF.hasExtraFiles(); + for (const auto &IL : ILF) { + Inlinee.Sites.emplace_back(); + auto &Site = Inlinee.Sites.back(); + if (auto Result = getNameFromChecksumsBuffer(IL.Header->FileID)) + Site.FileName = *Result; + else + return Result.takeError(); + + Site.Inlinee = IL.Header->Inlinee; + Site.SourceLineNum = IL.Header->SourceLineNum; + if (ILF.hasExtraFiles()) { + for (const auto &EF : IL.ExtraFiles) { + if (auto Result = getNameFromChecksumsBuffer(EF)) + Site.ExtraFiles.push_back(*Result); + else + return Result.takeError(); + } + } + } + } + return Error::success(); + } + private: llvm::pdb::yaml::PdbSourceFileInfo &Info; |