From 7fa27ce4a07f19b07799a767fc29416f3b625afb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 26 Jul 2023 21:03:47 +0200 Subject: Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. --- llvm/lib/DWARFLinkerParallel/OutputSections.cpp | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 llvm/lib/DWARFLinkerParallel/OutputSections.cpp (limited to 'llvm/lib/DWARFLinkerParallel/OutputSections.cpp') 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::parseDebugSectionName(llvm::StringRef SecName) { + return llvm::StringSwitch>( + 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 -- cgit v1.2.3