LLVM 23.0.0git
SFrame.cpp
Go to the documentation of this file.
1//===-- SFrame.cpp -----------------------------------------------*- C++-*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
10#include "llvm/ADT/Enum.h"
11
12using namespace llvm;
13
15 constexpr EnumStringDef<Version> VersionDefs[] = {
16#define HANDLE_SFRAME_VERSION(CODE, NAME) {{#NAME}, sframe::Version::NAME},
17#include "llvm/BinaryFormat/SFrameConstants.def"
18 };
19 static constexpr auto Versions = BUILD_ENUM_STRINGS(VersionDefs);
20 return EnumStrings(Versions);
21}
22
24 constexpr EnumStringDef<sframe::Flags> FlagDefs[] = {
25#define HANDLE_SFRAME_FLAG(CODE, NAME) {{#NAME}, sframe::Flags::NAME},
26#include "llvm/BinaryFormat/SFrameConstants.def"
27 };
28 static constexpr auto Flags = BUILD_ENUM_STRINGS(FlagDefs);
29 return EnumStrings(Flags);
30}
31
33 constexpr EnumStringDef<sframe::ABI> ABIDefs[] = {
34#define HANDLE_SFRAME_ABI(CODE, NAME) {{#NAME}, sframe::ABI::NAME},
35#include "llvm/BinaryFormat/SFrameConstants.def"
36 };
37 static constexpr auto ABIs = BUILD_ENUM_STRINGS(ABIDefs);
38 return EnumStrings(ABIs);
39}
40
42 constexpr EnumStringDef<sframe::FREType> FRETypeDefs[] = {
43#define HANDLE_SFRAME_FRE_TYPE(CODE, NAME) {{#NAME}, sframe::FREType::NAME},
44#include "llvm/BinaryFormat/SFrameConstants.def"
45 };
46 static constexpr auto FRETypes = BUILD_ENUM_STRINGS(FRETypeDefs);
47 return EnumStrings(FRETypes);
48}
49
51 constexpr EnumStringDef<sframe::FDEType> FDETypeDefs[] = {
52#define HANDLE_SFRAME_FDE_TYPE(CODE, NAME) {{#NAME}, sframe::FDEType::NAME},
53#include "llvm/BinaryFormat/SFrameConstants.def"
54 };
55 static constexpr auto FDETypes = BUILD_ENUM_STRINGS(FDETypeDefs);
56 return EnumStrings(FDETypes);
57}
58
60 constexpr EnumStringDef<sframe::AArch64PAuthKey> AArch64PAuthKeyDefs[] = {
61#define HANDLE_SFRAME_AARCH64_PAUTH_KEY(CODE, NAME) \
62 {{#NAME}, sframe::AArch64PAuthKey::NAME},
63#include "llvm/BinaryFormat/SFrameConstants.def"
64 };
65 static constexpr auto AArch64PAuthKeys =
66 BUILD_ENUM_STRINGS(AArch64PAuthKeyDefs);
67 return EnumStrings(AArch64PAuthKeys);
68}
69
71 constexpr EnumStringDef<sframe::FREOffset> FREOffsetDefs[] = {
72#define HANDLE_SFRAME_FRE_OFFSET(CODE, NAME) {{#NAME}, sframe::FREOffset::NAME},
73#include "llvm/BinaryFormat/SFrameConstants.def"
74 };
75 static constexpr auto FREOffsets = BUILD_ENUM_STRINGS(FREOffsetDefs);
76 return EnumStrings(FREOffsets);
77}
78
80 constexpr EnumStringDef<sframe::BaseReg> BaseRegDefs[] = {
81 {{"FP"}, sframe::BaseReg::FP},
82 {{"SP"}, sframe::BaseReg::SP},
83 };
84 static constexpr auto BaseRegs = BUILD_ENUM_STRINGS(BaseRegDefs);
85 return EnumStrings(BaseRegs);
86}
#define BUILD_ENUM_STRINGS(Tab)
Definition Enum.h:120
This file contains data-structure definitions and constants to support unwinding based on ....
LLVM_ABI EnumStrings< FREOffset, 1 > getFREOffsets()
Definition SFrame.cpp:70
LLVM_ABI EnumStrings< ABI, 1 > getABIs()
Definition SFrame.cpp:32
LLVM_ABI EnumStrings< AArch64PAuthKey, 1 > getAArch64PAuthKeys()
Definition SFrame.cpp:59
LLVM_ABI EnumStrings< FDEType, 1 > getFDETypes()
Definition SFrame.cpp:50
LLVM_ABI EnumStrings< Flags, 1 > getFlags()
Definition SFrame.cpp:23
LLVM_ABI EnumStrings< BaseReg, 1 > getBaseRegisters()
Definition SFrame.cpp:79
LLVM_ABI EnumStrings< Version, 1 > getVersions()
Definition SFrame.cpp:14
LLVM_ABI EnumStrings< FREType, 1 > getFRETypes()
Definition SFrame.cpp:41
This is an optimization pass for GlobalISel generic memory operations.
EnumStrings(const EnumStringsStorage< T, NumStrs, N, StrLen > &) -> EnumStrings< T, NumStrs >
Compile-time data representation of enum entries.
Definition Enum.h:47