LLVM 19.0.0git
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
11
12using namespace llvm;
13using namespace llvm::dwarf_linker;
14
15std::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}
@ Default
Definition: DwarfDebug.cpp:87
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
Definition: StringRef.h:563
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:251
A switch()-like statement whose cases are string literals.
Definition: StringSwitch.h:44
std::optional< DebugSectionKind > parseDebugTableName(StringRef Name)
Recognise the table name and match it with the DebugSectionKind.
static constexpr const StringLiteral & getSectionName(DebugSectionKind SectionKind)
Return the name of the section.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18