1 //=== OutputSections.cpp --------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "OutputSections.h"
10 #include "llvm/ADT/StringSwitch.h"
13 namespace dwarflinker_parallel
{
15 std::optional
<OutputSections::DebugSectionKind
>
16 OutputSections::parseDebugSectionName(llvm::StringRef SecName
) {
17 return llvm::StringSwitch
<std::optional
<OutputSections::DebugSectionKind
>>(
19 .Case("debug_info", DebugSectionKind::DebugInfo
)
20 .Case("debug_line", DebugSectionKind::DebugLine
)
21 .Case("debug_frame", DebugSectionKind::DebugFrame
)
22 .Case("debug_ranges", DebugSectionKind::DebugRange
)
23 .Case("debug_rnglists", DebugSectionKind::DebugRngLists
)
24 .Case("debug_loc", DebugSectionKind::DebugLoc
)
25 .Case("debug_loclists", DebugSectionKind::DebugLocLists
)
26 .Case("debug_aranges", DebugSectionKind::DebugARanges
)
27 .Case("debug_abbrev", DebugSectionKind::DebugAbbrev
)
28 .Case("debug_macinfo", DebugSectionKind::DebugMacinfo
)
29 .Case("debug_macro", DebugSectionKind::DebugMacro
)
30 .Default(std::nullopt
);
35 } // end of namespace dwarflinker_parallel
36 } // end of namespace llvm