summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp')
-rw-r--r--llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
index 65752ac9e05..23f9af6ab10 100644
--- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
+++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
@@ -1010,17 +1010,12 @@ Error DumpOutputStyle::dumpOldFpo(PDBFile &File) {
ExitOnError Err("Error dumping old fpo data:");
auto &Dbi = Err(File.getPDBDbiStream());
- uint32_t Index = Dbi.getDebugStreamIndex(DbgHeaderType::FPO);
- if (Index == kInvalidStreamIndex) {
+ if (!Dbi.hasOldFpoRecords()) {
printStreamNotPresent("FPO");
return Error::success();
}
- std::unique_ptr<MappedBlockStream> OldFpo = File.createIndexedStream(Index);
- BinaryStreamReader Reader(*OldFpo);
- FixedStreamArray<object::FpoData> Records;
- Err(Reader.readArray(Records,
- Reader.bytesRemaining() / sizeof(object::FpoData)));
+ const FixedStreamArray<object::FpoData>& Records = Dbi.getOldFpoRecords();
P.printLine(" RVA | Code | Locals | Params | Prolog | Saved Regs | Use "
"BP | Has SEH | Frame Type");
@@ -1042,18 +1037,12 @@ Error DumpOutputStyle::dumpNewFpo(PDBFile &File) {
ExitOnError Err("Error dumping new fpo data:");
auto &Dbi = Err(File.getPDBDbiStream());
- uint32_t Index = Dbi.getDebugStreamIndex(DbgHeaderType::NewFPO);
- if (Index == kInvalidStreamIndex) {
+ if (!Dbi.hasNewFpoRecords()) {
printStreamNotPresent("New FPO");
return Error::success();
}
- std::unique_ptr<MappedBlockStream> NewFpo = File.createIndexedStream(Index);
-
- DebugFrameDataSubsectionRef FDS;
- if (auto EC = FDS.initialize(*NewFpo))
- return make_error<RawError>(raw_error_code::corrupt_file,
- "Invalid new fpo stream");
+ const DebugFrameDataSubsectionRef& FDS = Dbi.getNewFpoRecords();
P.printLine(" RVA | Code | Locals | Params | Stack | Prolog | Saved Regs "
"| Has SEH | Has C++EH | Start | Program");
OpenPOWER on IntegriCloud