//===-- SFrame.cpp -----------------------------------------------*- C++-*-===// // // 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 "llvm/BinaryFormat/SFrame.h" #include "llvm/ADT/Enum.h" using namespace llvm; EnumStrings sframe::getVersions() { constexpr EnumStringDef VersionDefs[] = { #define HANDLE_SFRAME_VERSION(CODE, NAME) {{#NAME}, sframe::Version::NAME}, #include "llvm/BinaryFormat/SFrameConstants.def" }; static constexpr auto Versions = BUILD_ENUM_STRINGS(VersionDefs); return EnumStrings(Versions); } EnumStrings sframe::getFlags() { constexpr EnumStringDef FlagDefs[] = { #define HANDLE_SFRAME_FLAG(CODE, NAME) {{#NAME}, sframe::Flags::NAME}, #include "llvm/BinaryFormat/SFrameConstants.def" }; static constexpr auto Flags = BUILD_ENUM_STRINGS(FlagDefs); return EnumStrings(Flags); } EnumStrings sframe::getABIs() { constexpr EnumStringDef ABIDefs[] = { #define HANDLE_SFRAME_ABI(CODE, NAME) {{#NAME}, sframe::ABI::NAME}, #include "llvm/BinaryFormat/SFrameConstants.def" }; static constexpr auto ABIs = BUILD_ENUM_STRINGS(ABIDefs); return EnumStrings(ABIs); } EnumStrings sframe::getFRETypes() { constexpr EnumStringDef FRETypeDefs[] = { #define HANDLE_SFRAME_FRE_TYPE(CODE, NAME) {{#NAME}, sframe::FREType::NAME}, #include "llvm/BinaryFormat/SFrameConstants.def" }; static constexpr auto FRETypes = BUILD_ENUM_STRINGS(FRETypeDefs); return EnumStrings(FRETypes); } EnumStrings sframe::getFDETypes() { constexpr EnumStringDef FDETypeDefs[] = { #define HANDLE_SFRAME_FDE_TYPE(CODE, NAME) {{#NAME}, sframe::FDEType::NAME}, #include "llvm/BinaryFormat/SFrameConstants.def" }; static constexpr auto FDETypes = BUILD_ENUM_STRINGS(FDETypeDefs); return EnumStrings(FDETypes); } EnumStrings sframe::getAArch64PAuthKeys() { constexpr EnumStringDef AArch64PAuthKeyDefs[] = { #define HANDLE_SFRAME_AARCH64_PAUTH_KEY(CODE, NAME) \ {{#NAME}, sframe::AArch64PAuthKey::NAME}, #include "llvm/BinaryFormat/SFrameConstants.def" }; static constexpr auto AArch64PAuthKeys = BUILD_ENUM_STRINGS(AArch64PAuthKeyDefs); return EnumStrings(AArch64PAuthKeys); } EnumStrings sframe::getFREOffsets() { constexpr EnumStringDef FREOffsetDefs[] = { #define HANDLE_SFRAME_FRE_OFFSET(CODE, NAME) {{#NAME}, sframe::FREOffset::NAME}, #include "llvm/BinaryFormat/SFrameConstants.def" }; static constexpr auto FREOffsets = BUILD_ENUM_STRINGS(FREOffsetDefs); return EnumStrings(FREOffsets); } EnumStrings sframe::getBaseRegisters() { constexpr EnumStringDef BaseRegDefs[] = { {{"FP"}, sframe::BaseReg::FP}, {{"SP"}, sframe::BaseReg::SP}, }; static constexpr auto BaseRegs = BUILD_ENUM_STRINGS(BaseRegDefs); return EnumStrings(BaseRegs); }