LLVM  13.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 
24 
25 using namespace llvm;
26 using namespace llvm::codeview;
27 
30  const StringsAndChecksumsRef &State) {
31  BinaryStreamReader Reader(R.getRecordData());
32  switch (R.kind()) {
34  DebugLinesSubsectionRef Fragment;
35  if (auto EC = Fragment.initialize(Reader))
36  return EC;
37 
38  return V.visitLines(Fragment, State);
39  }
42  if (auto EC = Fragment.initialize(Reader))
43  return EC;
44 
45  return V.visitFileChecksums(Fragment, State);
46  }
49  if (auto EC = Fragment.initialize(Reader))
50  return EC;
51  return V.visitInlineeLines(Fragment, State);
52  }
55  if (auto EC = Section.initialize(Reader))
56  return EC;
57  return V.visitCrossModuleExports(Section, State);
58  }
61  if (auto EC = Section.initialize(Reader))
62  return EC;
63  return V.visitCrossModuleImports(Section, State);
64  }
67  if (auto EC = Section.initialize(Reader))
68  return EC;
69  return V.visitSymbols(Section, State);
70  }
73  if (auto EC = Section.initialize(Reader))
74  return EC;
75  return V.visitStringTable(Section, State);
76  }
79  if (auto EC = Section.initialize(Reader))
80  return EC;
81  return V.visitFrameData(Section, State);
82  }
85  if (auto EC = Section.initialize(Reader))
86  return EC;
87  return V.visitCOFFSymbolRVAs(Section, State);
88  }
89  default: {
90  DebugUnknownSubsectionRef Fragment(R.kind(), R.getRecordData());
91  return V.visitUnknown(Fragment);
92  }
93  }
94 }
llvm::codeview::DebugUnknownSubsectionRef
Definition: DebugUnknownSubsection.h:18
BinaryStreamReader.h
llvm::codeview::DebugSubsectionKind::InlineeLines
@ InlineeLines
llvm
Definition: AllocatorList.h:23
llvm::codeview::DebugSubsectionVisitor::visitUnknown
virtual Error visitUnknown(DebugUnknownSubsectionRef &Unknown)
Definition: DebugSubsectionVisitor.h:36
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:20
llvm::codeview::DebugSubsectionVisitor::visitCOFFSymbolRVAs
virtual Error visitCOFFSymbolRVAs(DebugSymbolRVASubsectionRef &RVAs, const StringsAndChecksumsRef &State)=0
llvm::codeview::DebugSubsectionKind::CrossScopeExports
@ CrossScopeExports
llvm::codeview::DebugSubsectionKind::StringTable
@ StringTable
DebugCrossExSubsection.h
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::codeview::DebugInlineeLinesSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugInlineeLinesSubsection.cpp:45
llvm::codeview::DebugSubsectionVisitor::visitCrossModuleImports
virtual Error visitCrossModuleImports(DebugCrossModuleImportsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
llvm::codeview::StringsAndChecksumsRef
Definition: StringsAndChecksums.h:21
llvm::codeview::DebugSubsectionVisitor::visitInlineeLines
virtual Error visitInlineeLines(DebugInlineeLinesSubsectionRef &Inlinees, const StringsAndChecksumsRef &State)=0
llvm::codeview::DebugCrossModuleExportsSubsectionRef
Definition: DebugCrossExSubsection.h:24
DebugChecksumsSubsection.h
DebugSubsectionRecord.h
llvm::codeview::DebugSubsectionKind::CrossScopeImports
@ CrossScopeImports
llvm::codeview::DebugSymbolRVASubsectionRef
Definition: DebugSymbolRVASubsection.h:26
llvm::codeview::DebugSubsectionKind::FileChecksums
@ FileChecksums
DebugSubsectionVisitor.h
llvm::BinaryStreamReader
Provides read only access to a subclass of BinaryStream.
Definition: BinaryStreamReader.h:31
DebugLinesSubsection.h
llvm::codeview::DebugLinesSubsectionRef
Definition: DebugLinesSubsection.h:78
llvm::codeview::DebugCrossModuleImportsSubsectionRef
Definition: DebugCrossImpSubsection.h:47
llvm::codeview::DebugSubsectionRecord
Definition: DebugSubsectionRecord.h:35
llvm::codeview::CompileSym2Flags::EC
@ EC
DebugUnknownSubsection.h
BinaryStreamRef.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:28
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:157
DebugCrossImpSubsection.h
DebugSymbolsSubsection.h
llvm::codeview::DebugInlineeLinesSubsectionRef
Definition: DebugInlineeLinesSubsection.h:61
llvm::codeview::DebugSubsectionVisitor::visitSymbols
virtual Error visitSymbols(DebugSymbolsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
DebugStringTableSubsection.h
llvm::codeview::DebugSubsectionVisitor
Definition: DebugSubsectionVisitor.h:32
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:49
llvm::codeview::DebugChecksumsSubsectionRef::initialize
Error initialize(BinaryStreamReader Reader)
Definition: DebugChecksumsSubsection.cpp:51
llvm::codeview::DebugSubsectionKind::FrameData
@ FrameData