LLVM 20.0.0git
DebugSubsectionVisitor.h
Go to the documentation of this file.
1//===- DebugSubsectionVisitor.h -----------------------------*- 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
9#ifndef LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTIONVISITOR_H
10#define LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTIONVISITOR_H
11
13#include "llvm/Support/Error.h"
14
15namespace llvm {
16
17namespace codeview {
18
19class DebugChecksumsSubsectionRef;
20class DebugSubsectionRecord;
21class DebugInlineeLinesSubsectionRef;
22class DebugCrossModuleExportsSubsectionRef;
23class DebugCrossModuleImportsSubsectionRef;
24class DebugFrameDataSubsectionRef;
25class DebugLinesSubsectionRef;
26class DebugStringTableSubsectionRef;
27class DebugSymbolRVASubsectionRef;
28class DebugSymbolsSubsectionRef;
29class DebugUnknownSubsectionRef;
30
32public:
33 virtual ~DebugSubsectionVisitor() = default;
34
36 return Error::success();
37 }
39 const StringsAndChecksumsRef &State) = 0;
41 const StringsAndChecksumsRef &State) = 0;
43 const StringsAndChecksumsRef &State) = 0;
44 virtual Error
46 const StringsAndChecksumsRef &State) = 0;
47 virtual Error
49 const StringsAndChecksumsRef &State) = 0;
50
52 const StringsAndChecksumsRef &State) = 0;
53
55 const StringsAndChecksumsRef &State) = 0;
56
58 const StringsAndChecksumsRef &State) = 0;
60 const StringsAndChecksumsRef &State) = 0;
61};
62
65 const StringsAndChecksumsRef &State);
66
67namespace detail {
68template <typename T>
71 State.initialize(std::forward<T>(FragmentRange));
72
73 for (const DebugSubsectionRecord &L : FragmentRange) {
74 if (auto EC = visitDebugSubsection(L, V, State))
75 return EC;
76 }
77 return Error::success();
78}
79} // namespace detail
80
81template <typename T>
84 return detail::visitDebugSubsections(std::forward<T>(FragmentRange), V,
85 State);
86}
87
88template <typename T>
90 const DebugStringTableSubsectionRef &Strings) {
91 StringsAndChecksumsRef State(Strings);
92 return detail::visitDebugSubsections(std::forward<T>(FragmentRange), V,
93 State);
94}
95
96template <typename T>
98 const DebugStringTableSubsectionRef &Strings,
99 const DebugChecksumsSubsectionRef &Checksums) {
100 StringsAndChecksumsRef State(Strings, Checksums);
101 return detail::visitDebugSubsections(std::forward<T>(FragmentRange), V,
102 State);
103}
104
105} // end namespace codeview
106
107} // end namespace llvm
108
109#endif // LLVM_DEBUGINFO_CODEVIEW_DEBUGSUBSECTIONVISITOR_H
separate const offset from Split GEPs to a variadic base and a constant offset for better CSE
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
static ErrorSuccess success()
Create a success value.
Definition: Error.h:337
Represents a read-only view of a CodeView string table.
virtual Error visitCOFFSymbolRVAs(DebugSymbolRVASubsectionRef &RVAs, const StringsAndChecksumsRef &State)=0
virtual Error visitSymbols(DebugSymbolsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
virtual Error visitFrameData(DebugFrameDataSubsectionRef &FD, const StringsAndChecksumsRef &State)=0
virtual Error visitInlineeLines(DebugInlineeLinesSubsectionRef &Inlinees, const StringsAndChecksumsRef &State)=0
virtual Error visitCrossModuleExports(DebugCrossModuleExportsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
virtual Error visitUnknown(DebugUnknownSubsectionRef &Unknown)
virtual Error visitFileChecksums(DebugChecksumsSubsectionRef &Checksums, const StringsAndChecksumsRef &State)=0
virtual Error visitStringTable(DebugStringTableSubsectionRef &ST, const StringsAndChecksumsRef &State)=0
virtual Error visitLines(DebugLinesSubsectionRef &Lines, const StringsAndChecksumsRef &State)=0
virtual Error visitCrossModuleImports(DebugCrossModuleImportsSubsectionRef &CSE, const StringsAndChecksumsRef &State)=0
Error visitDebugSubsections(T &&FragmentRange, DebugSubsectionVisitor &V, StringsAndChecksumsRef &State)
Error visitDebugSubsections(T &&FragmentRange, DebugSubsectionVisitor &V)
Error visitDebugSubsection(const DebugSubsectionRecord &R, DebugSubsectionVisitor &V, const StringsAndChecksumsRef &State)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18