LLVM  16.0.0git
DebugSubsectionVisitor.cpp
Go to the documentation of this file.
1 //===- DebugSubsectionVisitor.cpp -------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
25 
26 using namespace llvm;
27 using namespace llvm::codeview;
28 
31  const StringsAndChecksumsRef &State) {
32  BinaryStreamReader Reader(R.getRecordData());
33  switch (R.kind()) {
35  DebugLinesSubsectionRef Fragment;
36  if (auto EC = Fragment.initialize(Reader))
37  return EC;
38 
39  return V.visitLines(Fragment, State);
40  }
43  if (auto EC = Fragment.initialize(Reader))
44  return EC;
45 
46  return V.visitFileChecksums(Fragment, State);
47  }
50  if (auto EC = Fragment.initialize(Reader))
51  return EC;
52  return V.visitInlineeLines(Fragment, State);
53  }
56  if (auto EC = Section.initialize(Reader))
57  return EC;
58  return V.visitCrossModuleExports(Section, State);
59  }
62  if (auto EC = Section.initialize(Reader))
63  return EC;
64  return V.visitCrossModuleImports(Section, State);
65  }
68  if (auto EC = Section.initialize(Reader))
69  return EC;
70  return V.visitSymbols(Section, State);
71  }
74  if (auto EC = Section.initialize(Reader))
75  return EC;
76  return V.visitStringTable(Section, State);
77  }
80  if (auto EC = Section.initialize(Reader))
81  return EC;
82  return V.visitFrameData(Section, State);
83  }
86  if (auto EC = Section.initialize(Reader))
87  return EC;
88  return V.visitCOFFSymbolRVAs(Section, State);
89  }
90  default: {
91  DebugUnknownSubsectionRef Fragment(R.kind(), R.getRecordData());
92  return V.visitUnknown(Fragment);
93  }
94  }
95 }
llvm::codeview::DebugUnknownSubsectionRef
Definition: DebugUnknownSubsection.h:18
BinaryStreamReader.h
llvm::codeview::DebugSubsectionKind::InlineeLines
@ InlineeLines
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::codeview::DebugSubsectionVisitor::visitUnknown
virtual Error visitUnknown(DebugUnknownSubsectionRef &Unknown)
Definition: DebugSubsectionVisitor.h:35
llvm::codeview::DebugSubsectionVisitor::visitLines
virtual Error visitLines(DebugLinesSubsectionRef &Lines, const StringsAndChecksumsRef &State)=0
llvm::codeview::DebugSubsectionKind::CoffSymbolRVA
@ CoffSymbolRVA
llvm::codeview::DebugSubsectionKind::Lines
@ Lines
llvm::codeview::DebugLinesSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugLinesSubsection.cpp:56
DebugSymbolRVASubsection.h
llvm::codeview::DebugFrameDataSubsectionRef
Definition: DebugFrameDataSubsection.h:24
llvm::codeview::DebugSubsectionVisitor::visitCOFFSymbolRVAs
virtual Error visitCOFFSymbolRVAs(DebugSymbolRVASubsectionRef &RVAs, const StringsAndChecksumsRef &State)=0
SwapByteOrder.h
llvm::codeview::DebugSubsectionKind::CrossScopeExports
@ CrossScopeExports
llvm::codeview::DebugSubsectionKind::StringTable
@ StringTable
DebugCrossExSubsection.h
llvm::codeview::DebugInlineeLinesSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugInlineeLinesSubsection.cpp:46
llvm::codeview::DebugSubsectionVisitor::visitCrossModuleImports
virtual Error visitCrossModuleImports(DebugCrossModuleImportsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
llvm::codeview::StringsAndChecksumsRef
Definition: StringsAndChecksums.h:23
llvm::codeview::DebugSubsectionVisitor::visitInlineeLines
virtual Error visitInlineeLines(DebugInlineeLinesSubsectionRef &Inlinees, const StringsAndChecksumsRef &State)=0
llvm::codeview::DebugCrossModuleExportsSubsectionRef
Definition: DebugCrossExSubsection.h:25
DebugChecksumsSubsection.h
DebugSubsectionRecord.h
llvm::codeview::DebugSubsectionKind::CrossScopeImports
@ CrossScopeImports
llvm::codeview::DebugSymbolRVASubsectionRef
Definition: DebugSymbolRVASubsection.h:26
llvm::codeview::DebugSubsectionKind::FileChecksums
@ FileChecksums
CodeView.h
DebugSubsectionVisitor.h
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:29
DebugLinesSubsection.h
llvm::codeview::DebugLinesSubsectionRef
Definition: DebugLinesSubsection.h:79
llvm::codeview::DebugCrossModuleImportsSubsectionRef
Definition: DebugCrossImpSubsection.h:48
llvm::codeview::DebugSubsectionRecord
Definition: DebugSubsectionRecord.h:35
llvm::codeview::CompileSym2Flags::EC
@ EC
DebugUnknownSubsection.h
llvm::codeview::DebugSubsectionVisitor::visitStringTable
virtual Error visitStringTable(DebugStringTableSubsectionRef &ST, const StringsAndChecksumsRef &State)=0
llvm::codeview::DebugSubsectionVisitor::visitFileChecksums
virtual Error visitFileChecksums(DebugChecksumsSubsectionRef &Checksums, const StringsAndChecksumsRef &State)=0
llvm::codeview::visitDebugSubsection
Error visitDebugSubsection(const DebugSubsectionRecord &R, DebugSubsectionVisitor &V, const StringsAndChecksumsRef &State)
Definition: DebugSubsectionVisitor.cpp:29
llvm::codeview::DebugSubsectionKind::Symbols
@ Symbols
DebugInlineeLinesSubsection.h
llvm::codeview::DebugSubsectionVisitor::visitFrameData
virtual Error visitFrameData(DebugFrameDataSubsectionRef &FD, const StringsAndChecksumsRef &State)=0
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
DebugCrossImpSubsection.h
DebugSymbolsSubsection.h
llvm::codeview::DebugInlineeLinesSubsectionRef
Definition: DebugInlineeLinesSubsection.h:60
llvm::codeview::DebugSubsectionVisitor::visitSymbols
virtual Error visitSymbols(DebugSymbolsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
DebugStringTableSubsection.h
llvm::codeview::DebugSubsectionVisitor
Definition: DebugSubsectionVisitor.h:31
llvm::codeview
Definition: AppendingTypeTableBuilder.h:22
llvm::codeview::DebugStringTableSubsectionRef
Represents a read-only view of a CodeView string table.
Definition: DebugStringTableSubsection.h:31
DebugFrameDataSubsection.h
llvm::codeview::DebugSubsectionVisitor::visitCrossModuleExports
virtual Error visitCrossModuleExports(DebugCrossModuleExportsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
llvm::codeview::DebugSymbolsSubsectionRef
Definition: DebugSymbolsSubsection.h:18
llvm::codeview::DebugChecksumsSubsectionRef
Definition: DebugChecksumsSubsection.h:51
llvm::codeview::DebugChecksumsSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugChecksumsSubsection.cpp:51
llvm::codeview::DebugSubsectionKind::FrameData
@ FrameData