LLVM
22.0.0git
lib
DWARFLinker
DWARFLinkerBase.cpp
Go to the documentation of this file.
1
//=== DWARFLinkerBase.cpp -------------------------------------------------===//
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
#include "
llvm/DWARFLinker/DWARFLinkerBase.h
"
10
#include "
llvm/ADT/StringSwitch.h
"
11
12
using namespace
llvm
;
13
using namespace
llvm::dwarf_linker
;
14
15
std::optional<DebugSectionKind>
16
llvm::dwarf_linker::parseDebugTableName
(
llvm::StringRef
SecName) {
17
return
llvm::StringSwitch<std::optional<DebugSectionKind>
>(
18
SecName.
substr
(SecName.
find_first_not_of
(
"._"
)))
19
.
Case
(
getSectionName
(
DebugSectionKind::DebugInfo
),
20
DebugSectionKind::DebugInfo
)
21
.
Case
(
getSectionName
(
DebugSectionKind::DebugLine
),
22
DebugSectionKind::DebugLine
)
23
.
Case
(
getSectionName
(
DebugSectionKind::DebugFrame
),
24
DebugSectionKind::DebugFrame
)
25
.
Case
(
getSectionName
(
DebugSectionKind::DebugRange
),
26
DebugSectionKind::DebugRange
)
27
.
Case
(
getSectionName
(
DebugSectionKind::DebugRngLists
),
28
DebugSectionKind::DebugRngLists
)
29
.
Case
(
getSectionName
(
DebugSectionKind::DebugLoc
),
30
DebugSectionKind::DebugLoc
)
31
.
Case
(
getSectionName
(
DebugSectionKind::DebugLocLists
),
32
DebugSectionKind::DebugLocLists
)
33
.
Case
(
getSectionName
(
DebugSectionKind::DebugARanges
),
34
DebugSectionKind::DebugARanges
)
35
.
Case
(
getSectionName
(
DebugSectionKind::DebugAbbrev
),
36
DebugSectionKind::DebugAbbrev
)
37
.
Case
(
getSectionName
(
DebugSectionKind::DebugMacinfo
),
38
DebugSectionKind::DebugMacinfo
)
39
.
Case
(
getSectionName
(
DebugSectionKind::DebugMacro
),
40
DebugSectionKind::DebugMacro
)
41
.
Case
(
getSectionName
(
DebugSectionKind::DebugAddr
),
42
DebugSectionKind::DebugAddr
)
43
.
Case
(
getSectionName
(
DebugSectionKind::DebugStr
),
44
DebugSectionKind::DebugStr
)
45
.
Case
(
getSectionName
(
DebugSectionKind::DebugLineStr
),
46
DebugSectionKind::DebugLineStr
)
47
.
Case
(
getSectionName
(
DebugSectionKind::DebugStrOffsets
),
48
DebugSectionKind::DebugStrOffsets
)
49
.
Case
(
getSectionName
(
DebugSectionKind::DebugPubNames
),
50
DebugSectionKind::DebugPubNames
)
51
.
Case
(
getSectionName
(
DebugSectionKind::DebugPubTypes
),
52
DebugSectionKind::DebugPubTypes
)
53
.
Case
(
getSectionName
(
DebugSectionKind::DebugNames
),
54
DebugSectionKind::DebugNames
)
55
.
Case
(
getSectionName
(
DebugSectionKind::AppleNames
),
56
DebugSectionKind::AppleNames
)
57
.
Case
(
getSectionName
(
DebugSectionKind::AppleNamespaces
),
58
DebugSectionKind::AppleNamespaces
)
59
.
Case
(
getSectionName
(
DebugSectionKind::AppleObjC
),
60
DebugSectionKind::AppleObjC
)
61
.
Case
(
getSectionName
(
DebugSectionKind::AppleTypes
),
62
DebugSectionKind::AppleTypes
)
63
.
Default
(std::nullopt);
64
}
DWARFLinkerBase.h
StringSwitch.h
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition
StringRef.h:55
llvm::StringRef::substr
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
Definition
StringRef.h:581
llvm::StringRef::find_first_not_of
LLVM_ABI size_t find_first_not_of(char C, size_t From=0) const
Find the first character in the string that is not C or npos if not found.
Definition
StringRef.cpp:252
llvm::StringSwitch
A switch()-like statement whose cases are string literals.
Definition
StringSwitch.h:43
llvm::StringSwitch::Case
StringSwitch & Case(StringLiteral S, T Value)
Definition
StringSwitch.h:68
llvm::StringSwitch::Default
R Default(T Value)
Definition
StringSwitch.h:177
llvm::dwarf_linker
Definition
DWARFDebugMacro.h:22
llvm::dwarf_linker::parseDebugTableName
LLVM_ABI std::optional< DebugSectionKind > parseDebugTableName(StringRef Name)
Recognise the table name and match it with the DebugSectionKind.
Definition
DWARFLinkerBase.cpp:16
llvm::dwarf_linker::getSectionName
static constexpr const StringLiteral & getSectionName(DebugSectionKind SectionKind)
Return the name of the section.
Definition
DWARFLinkerBase.h:67
llvm::dwarf_linker::DebugSectionKind::DebugLocLists
@ DebugLocLists
Definition
DWARFLinkerBase.h:35
llvm::dwarf_linker::DebugSectionKind::AppleTypes
@ AppleTypes
Definition
DWARFLinkerBase.h:50
llvm::dwarf_linker::DebugSectionKind::DebugNames
@ DebugNames
Definition
DWARFLinkerBase.h:46
llvm::dwarf_linker::DebugSectionKind::DebugMacinfo
@ DebugMacinfo
Definition
DWARFLinkerBase.h:38
llvm::dwarf_linker::DebugSectionKind::DebugARanges
@ DebugARanges
Definition
DWARFLinkerBase.h:36
llvm::dwarf_linker::DebugSectionKind::AppleNames
@ AppleNames
Definition
DWARFLinkerBase.h:47
llvm::dwarf_linker::DebugSectionKind::DebugRange
@ DebugRange
Definition
DWARFLinkerBase.h:32
llvm::dwarf_linker::DebugSectionKind::DebugLine
@ DebugLine
Definition
DWARFLinkerBase.h:30
llvm::dwarf_linker::DebugSectionKind::DebugAbbrev
@ DebugAbbrev
Definition
DWARFLinkerBase.h:37
llvm::dwarf_linker::DebugSectionKind::AppleObjC
@ AppleObjC
Definition
DWARFLinkerBase.h:49
llvm::dwarf_linker::DebugSectionKind::AppleNamespaces
@ AppleNamespaces
Definition
DWARFLinkerBase.h:48
llvm::dwarf_linker::DebugSectionKind::DebugRngLists
@ DebugRngLists
Definition
DWARFLinkerBase.h:33
llvm::dwarf_linker::DebugSectionKind::DebugPubTypes
@ DebugPubTypes
Definition
DWARFLinkerBase.h:45
llvm::dwarf_linker::DebugSectionKind::DebugPubNames
@ DebugPubNames
Definition
DWARFLinkerBase.h:44
llvm::dwarf_linker::DebugSectionKind::DebugLoc
@ DebugLoc
Definition
DWARFLinkerBase.h:34
llvm::dwarf_linker::DebugSectionKind::DebugLineStr
@ DebugLineStr
Definition
DWARFLinkerBase.h:42
llvm::dwarf_linker::DebugSectionKind::DebugMacro
@ DebugMacro
Definition
DWARFLinkerBase.h:39
llvm::dwarf_linker::DebugSectionKind::DebugStr
@ DebugStr
Definition
DWARFLinkerBase.h:41
llvm::dwarf_linker::DebugSectionKind::DebugAddr
@ DebugAddr
Definition
DWARFLinkerBase.h:40
llvm::dwarf_linker::DebugSectionKind::DebugFrame
@ DebugFrame
Definition
DWARFLinkerBase.h:31
llvm::dwarf_linker::DebugSectionKind::DebugInfo
@ DebugInfo
Definition
DWARFLinkerBase.h:29
llvm::dwarf_linker::DebugSectionKind::DebugStrOffsets
@ DebugStrOffsets
Definition
DWARFLinkerBase.h:43
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
Generated on
for LLVM by
1.14.0