Path: blob/main/contrib/llvm-project/llvm/lib/DWARFLinker/DWARFLinkerBase.cpp
35259 views
//=== DWARFLinkerBase.cpp -------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/DWARFLinker/DWARFLinkerBase.h"9#include "llvm/ADT/StringSwitch.h"1011using namespace llvm;12using namespace llvm::dwarf_linker;1314std::optional<DebugSectionKind>15llvm::dwarf_linker::parseDebugTableName(llvm::StringRef SecName) {16return llvm::StringSwitch<std::optional<DebugSectionKind>>(17SecName.substr(SecName.find_first_not_of("._")))18.Case(getSectionName(DebugSectionKind::DebugInfo),19DebugSectionKind::DebugInfo)20.Case(getSectionName(DebugSectionKind::DebugLine),21DebugSectionKind::DebugLine)22.Case(getSectionName(DebugSectionKind::DebugFrame),23DebugSectionKind::DebugFrame)24.Case(getSectionName(DebugSectionKind::DebugRange),25DebugSectionKind::DebugRange)26.Case(getSectionName(DebugSectionKind::DebugRngLists),27DebugSectionKind::DebugRngLists)28.Case(getSectionName(DebugSectionKind::DebugLoc),29DebugSectionKind::DebugLoc)30.Case(getSectionName(DebugSectionKind::DebugLocLists),31DebugSectionKind::DebugLocLists)32.Case(getSectionName(DebugSectionKind::DebugARanges),33DebugSectionKind::DebugARanges)34.Case(getSectionName(DebugSectionKind::DebugAbbrev),35DebugSectionKind::DebugAbbrev)36.Case(getSectionName(DebugSectionKind::DebugMacinfo),37DebugSectionKind::DebugMacinfo)38.Case(getSectionName(DebugSectionKind::DebugMacro),39DebugSectionKind::DebugMacro)40.Case(getSectionName(DebugSectionKind::DebugAddr),41DebugSectionKind::DebugAddr)42.Case(getSectionName(DebugSectionKind::DebugStr),43DebugSectionKind::DebugStr)44.Case(getSectionName(DebugSectionKind::DebugLineStr),45DebugSectionKind::DebugLineStr)46.Case(getSectionName(DebugSectionKind::DebugStrOffsets),47DebugSectionKind::DebugStrOffsets)48.Case(getSectionName(DebugSectionKind::DebugPubNames),49DebugSectionKind::DebugPubNames)50.Case(getSectionName(DebugSectionKind::DebugPubTypes),51DebugSectionKind::DebugPubTypes)52.Case(getSectionName(DebugSectionKind::DebugNames),53DebugSectionKind::DebugNames)54.Case(getSectionName(DebugSectionKind::AppleNames),55DebugSectionKind::AppleNames)56.Case(getSectionName(DebugSectionKind::AppleNamespaces),57DebugSectionKind::AppleNamespaces)58.Case(getSectionName(DebugSectionKind::AppleObjC),59DebugSectionKind::AppleObjC)60.Case(getSectionName(DebugSectionKind::AppleTypes),61DebugSectionKind::AppleTypes)62.Default(std::nullopt);63}646566