LLVM 23.0.0git
AArch64BuildAttributes.cpp
Go to the documentation of this file.
1//===-- AArch64BuildAttributes.cpp - AArch64 Build Attributes -------------===//
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
11
12using namespace llvm;
13using namespace llvm::AArch64BuildAttributes;
14
16 switch (Vendor) {
18 return "aeabi_feature_and_bits";
19 case AEABI_PAUTHABI:
20 return "aeabi_pauthabi";
21 case VENDOR_UNKNOWN:
22 return "";
23 default:
24 assert(0 && "Vendor name error");
25 return "";
26 }
27}
29 return StringSwitch<VendorID>(Vendor)
30 .Case("aeabi_feature_and_bits", AEABI_FEATURE_AND_BITS)
31 .Case("aeabi_pauthabi", AEABI_PAUTHABI)
33}
34
36 switch (Optional) {
37 case REQUIRED:
38 return "required";
39 case OPTIONAL:
40 return "optional";
42 default:
43 return "";
44 }
45}
53 return "unknown AArch64 build attributes optionality, expected "
54 "required|optional";
55}
56
58 switch (Type) {
59 case ULEB128:
60 return "uleb128";
61 case NTBS:
62 return "ntbs";
63 case TYPE_NOT_FOUND:
64 default:
65 return "";
66 }
67}
70 .Cases({"uleb128", "ULEB128"}, ULEB128)
71 .Cases({"ntbs", "NTBS"}, NTBS)
73}
75 return "unknown AArch64 build attributes type, expected uleb128|ntbs";
76}
77
79 switch (PauthABITag) {
81 return "Tag_PAuth_Platform";
83 return "Tag_PAuth_Schema";
85 default:
86 return "";
87 }
88}
89
91 return StringSwitch<PauthABITags>(PauthABITag)
92 .Case("Tag_PAuth_Platform", TAG_PAUTH_PLATFORM)
93 .Case("Tag_PAuth_Schema", TAG_PAUTH_SCHEMA)
95}
96
99 switch (FeatureAndBitsTag) {
100 case TAG_FEATURE_BTI:
101 return "Tag_Feature_BTI";
102 case TAG_FEATURE_PAC:
103 return "Tag_Feature_PAC";
104 case TAG_FEATURE_GCS:
105 return "Tag_Feature_GCS";
107 default:
108 return "";
109 }
110}
111
114 return StringSwitch<FeatureAndBitsTags>(FeatureAndBitsTag)
115 .Case("Tag_Feature_BTI", TAG_FEATURE_BTI)
116 .Case("Tag_Feature_PAC", TAG_FEATURE_PAC)
117 .Case("Tag_Feature_GCS", TAG_FEATURE_GCS)
119}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & Cases(std::initializer_list< StringLiteral > CaseStrings, T Value)
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
LLVM_ABI SubsectionType getTypeID(StringRef Type)
LLVM_ABI StringRef getPauthABITagsStr(unsigned PauthABITag)
LLVM_ABI StringRef getVendorName(unsigned const Vendor)
LLVM_ABI StringRef getOptionalStr(unsigned Optional)
VendorID
AArch64 build attributes vendors IDs (a.k.a subsection name)
LLVM_ABI StringRef getSubsectionTypeUnknownError()
LLVM_ABI SubsectionOptional getOptionalID(StringRef Optional)
LLVM_ABI StringRef getSubsectionOptionalUnknownError()
LLVM_ABI FeatureAndBitsTags getFeatureAndBitsTagsID(StringRef FeatureAndBitsTag)
LLVM_ABI VendorID getVendorID(StringRef const Vendor)
LLVM_ABI PauthABITags getPauthABITagsID(StringRef PauthABITag)
LLVM_ABI StringRef getTypeStr(unsigned Type)
LLVM_ABI StringRef getFeatureAndBitsTagsStr(unsigned FeatureAndBitsTag)
This is an optimization pass for GlobalISel generic memory operations.
@ Default
The result value is uniform if and only if all operands are uniform.
Definition Uniformity.h:20