diff options
Diffstat (limited to 'llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp b/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp index 8f7aba6d30c..ae3138efb13 100644 --- a/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp +++ b/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp @@ -32,6 +32,13 @@ using namespace llvm; using namespace llvm::codeview; using namespace llvm::pdb; +static bool checkModuleSubsection(opts::ModuleSubsection MS) { + return any_of(opts::pdb2yaml::DumpModuleSubsections, + [=](opts::ModuleSubsection M) { + return M == MS || M == opts::ModuleSubsection::All; + }); +} + YAMLOutputStyle::YAMLOutputStyle(PDBFile &File) : File(File), Out(outs()), Obj(File.getAllocator()) { Out.setWriteDefaultValues(!opts::pdb2yaml::Minimal); @@ -93,8 +100,8 @@ Error YAMLOutputStyle::dumpFileHeaders() { } Error YAMLOutputStyle::dumpStringTable() { - bool RequiresStringTable = opts::shared::DumpModuleFiles || - !opts::shared::DumpModuleSubsections.empty(); + bool RequiresStringTable = opts::pdb2yaml::DumpModuleFiles || + !opts::pdb2yaml::DumpModuleSubsections.empty(); bool RequestedStringTable = opts::pdb2yaml::StringTable; if (!RequiresStringTable && !RequestedStringTable) return Error::success(); @@ -201,7 +208,7 @@ Error YAMLOutputStyle::dumpDbiStream() { Obj.DbiStream->PdbDllRbld = DS.getPdbDllRbld(); Obj.DbiStream->PdbDllVersion = DS.getPdbDllVersion(); Obj.DbiStream->VerHeader = DS.getDbiVersion(); - if (opts::shared::DumpModules) { + if (opts::pdb2yaml::DumpModules) { const auto &Modules = DS.modules(); for (uint32_t I = 0; I < Modules.getModuleCount(); ++I) { DbiModuleDescriptor MI = Modules.getModuleDescriptor(I); @@ -211,7 +218,7 @@ Error YAMLOutputStyle::dumpDbiStream() { DMI.Mod = MI.getModuleName(); DMI.Obj = MI.getObjFileName(); - if (opts::shared::DumpModuleFiles) { + if (opts::pdb2yaml::DumpModuleFiles) { auto Files = Modules.source_files(I); DMI.SourceFiles.assign(Files.begin(), Files.end()); } @@ -231,7 +238,7 @@ Error YAMLOutputStyle::dumpDbiStream() { auto ExpectedST = File.getStringTable(); if (!ExpectedST) return ExpectedST.takeError(); - if (!opts::shared::DumpModuleSubsections.empty() && + if (!opts::pdb2yaml::DumpModuleSubsections.empty() && ModS.hasDebugSubsections()) { auto ExpectedChecksums = ModS.findChecksumsSubsection(); if (!ExpectedChecksums) @@ -242,7 +249,7 @@ Error YAMLOutputStyle::dumpDbiStream() { for (const auto &SS : ModS.subsections()) { opts::ModuleSubsection OptionKind = convertSubsectionKind(SS.kind()); - if (!opts::checkModuleSubsection(OptionKind)) + if (!checkModuleSubsection(OptionKind)) continue; auto Converted = @@ -253,7 +260,7 @@ Error YAMLOutputStyle::dumpDbiStream() { } } - if (opts::shared::DumpModuleSyms) { + if (opts::pdb2yaml::DumpModuleSyms) { DMI.Modi.emplace(); DMI.Modi->Signature = ModS.signature(); |