diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:03:47 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-07-26 19:04:23 +0000 |
| commit | 7fa27ce4a07f19b07799a767fc29416f3b625afb (patch) | |
| tree | 27825c83636c4de341eb09a74f49f5d38a15d165 /llvm/lib/DWARFLinkerParallel/OutputSections.cpp | |
| parent | e3b557809604d036af6e00c60f012c2025b59a5e (diff) | |
Diffstat (limited to 'llvm/lib/DWARFLinkerParallel/OutputSections.cpp')
| -rw-r--r-- | llvm/lib/DWARFLinkerParallel/OutputSections.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/lib/DWARFLinkerParallel/OutputSections.cpp b/llvm/lib/DWARFLinkerParallel/OutputSections.cpp new file mode 100644 index 000000000000..69c5bfaa7bdf --- /dev/null +++ b/llvm/lib/DWARFLinkerParallel/OutputSections.cpp @@ -0,0 +1,36 @@ +//=== OutputSections.cpp --------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "OutputSections.h" +#include "llvm/ADT/StringSwitch.h" + +namespace llvm { +namespace dwarflinker_parallel { + +std::optional<OutputSections::DebugSectionKind> +OutputSections::parseDebugSectionName(llvm::StringRef SecName) { + return llvm::StringSwitch<std::optional<OutputSections::DebugSectionKind>>( + SecName) + .Case("debug_info", DebugSectionKind::DebugInfo) + .Case("debug_line", DebugSectionKind::DebugLine) + .Case("debug_frame", DebugSectionKind::DebugFrame) + .Case("debug_ranges", DebugSectionKind::DebugRange) + .Case("debug_rnglists", DebugSectionKind::DebugRngLists) + .Case("debug_loc", DebugSectionKind::DebugLoc) + .Case("debug_loclists", DebugSectionKind::DebugLocLists) + .Case("debug_aranges", DebugSectionKind::DebugARanges) + .Case("debug_abbrev", DebugSectionKind::DebugAbbrev) + .Case("debug_macinfo", DebugSectionKind::DebugMacinfo) + .Case("debug_macro", DebugSectionKind::DebugMacro) + .Default(std::nullopt); + + return std::nullopt; +} + +} // end of namespace dwarflinker_parallel +} // end of namespace llvm |
