19#define ATTRIBUTE_HANDLER(attr) \
20 { ARMBuildAttrs::attr, &ARMAttributeParser::attr }
22const ARMAttributeParser::DisplayHandler ARMAttributeParser::displayRoutines[] =
70#undef ATTRIBUTE_HANDLER
108 "ARM v8.1-M Mainline",
120 default: profile =
"Unknown";
break;
121 case 'A': profile =
"Application";
break;
122 case 'R': profile =
"Real-time";
break;
123 case 'M': profile =
"Microcontroller";
break;
124 case 'S': profile =
"Classic";
break;
125 case 0: profile =
"None";
break;
133 static const char *
const strings[] = {
"Not Permitted",
"Permitted"};
138 static const char *
const strings[] = {
"Not Permitted",
"Thumb-1",
"Thumb-2",
144 static const char *
const strings[] = {
145 "Not Permitted",
"VFPv1",
"VFPv2",
"VFPv3",
"VFPv3-D16",
146 "VFPv4",
"VFPv4-D16",
"ARMv8-a FP",
"ARMv8-a FP-D16"};
151 static const char *
const strings[] = {
"Not Permitted",
"WMMXv1",
"WMMXv2"};
156 static const char *
const strings[] = {
"Not Permitted",
"NEONv1",
"NEONv2+FMA",
157 "ARMv8-a NEON",
"ARMv8.1-a NEON"};
162 static const char *
const strings[] = {
"Not Permitted",
"MVE integer",
163 "MVE integer and float"};
168 static const char *
const strings[] = {
"None",
173 "Reserved (Palm OS)",
175 "Reserved (Symbian OS)"};
180 static const char *
const strings[] = {
"v6",
"Static Base",
"TLS",
"Unused"};
185 static const char *
const strings[] = {
"Absolute",
"PC-relative",
186 "SB-relative",
"Not Permitted"};
191 static const char *
const strings[] = {
"Absolute",
"PC-relative",
197 static const char *
const strings[] = {
"Not Permitted",
"Direct",
203 static const char *
const strings[] = {
"Not Permitted",
"Unknown",
"2-byte",
204 "Unknown",
"4-byte"};
209 static const char *
const strings[] = {
"IEEE-754",
"Runtime"};
214 static const char *
const strings[] = {
"Unsupported",
"IEEE-754",
"Sign Only"};
219 static const char *
const strings[] = {
"Not Permitted",
"IEEE-754"};
222Error ARMAttributeParser::ABI_FP_user_exceptions(
AttrType tag) {
223 static const char *
const strings[] = {
"Not Permitted",
"IEEE-754"};
228 static const char *
const strings[] = {
"Not Permitted",
"Finite Only",
"RTABI",
234 static const char *
const strings[] = {
"Not Permitted",
"8-byte alignment",
235 "4-byte alignment",
"Reserved"};
239 std::string description;
240 if (
value < std::size(strings))
241 description = strings[
value];
242 else if (
value <= 12)
243 description =
"8-byte alignment, " + utostr(1ULL <<
value) +
244 "-byte extended alignment";
246 description =
"Invalid";
253 static const char *strings[] = {
"Not Required",
"8-byte data alignment",
254 "8-byte data and code alignment",
"Reserved"};
258 std::string description;
259 if (
value < std::size(strings))
260 description = std::string(strings[
value]);
261 else if (
value <= 12)
262 description = std::string(
"8-byte stack alignment, ") +
263 utostr(1ULL <<
value) + std::string(
"-byte data alignment");
265 description =
"Invalid";
272 static const char *
const strings[] = {
"Not Permitted",
"Packed",
"Int32",
278 static const char *
const strings[] = {
"Tag_FP_arch",
"Single-Precision",
279 "Reserved",
"Tag_FP_arch (deprecated)"};
284 static const char *
const strings[] = {
"AAPCS",
"AAPCS VFP",
"Custom",
290 static const char *
const strings[] = {
"AAPCS",
"iWMMX",
"Custom"};
294Error ARMAttributeParser::ABI_optimization_goals(
AttrType tag) {
295 static const char *
const strings[] = {
296 "None",
"Speed",
"Aggressive Speed",
297 "Size",
"Aggressive Size",
"Debugging",
302Error ARMAttributeParser::ABI_FP_optimization_goals(
AttrType tag) {
303 static const char *
const strings[] = {
304 "None",
"Speed",
"Aggressive Speed",
"Size",
"Aggressive Size",
305 "Accuracy",
"Best Accuracy"};
317 sw->
startLine() <<
"Value: " << integer <<
", " <<
string <<
'\n';
336Error ARMAttributeParser::CPU_unaligned_access(
AttrType tag) {
337 static const char *
const strings[] = {
"Not Permitted",
"v6-style"};
342 static const char *
const strings[] = {
"If Available",
"Permitted"};
347 static const char *
const strings[] = {
"Not Permitted",
"IEEE-754",
"VFPv3"};
352 static const char *
const strings[] = {
"Not Permitted",
"Permitted"};
357 static const char *
const strings[] = {
"If Available",
"Not Permitted",
363 static const char *
const strings[] = {
"Not Permitted",
"Permitted"};
368 static const char *
const strings[] = {
"Not Permitted",
"Permitted"};
373 static const char *
const strings[] = {
374 "Not Permitted",
"TrustZone",
"Virtualization Extensions",
375 "TrustZone + Virtualization Extensions"};
380 static const char *
const strings[] = {
"Not Permitted",
381 "Permitted in NOP space",
"Permitted"};
386 static const char *
const strings[] = {
"Not Permitted",
387 "Permitted in NOP space",
"Permitted"};
392 static const char *
const strings[] = {
"Not Used",
"Used"};
397 static const char *
const strings[] = {
"Not Used",
"Used"};
407Error ARMAttributeParser::also_compatible_with(
AttrType tag) {
410 std::optional<Error> returnValue;
423 return Item.
attr == InnerTag;
426 if (!ValidInnerTag) {
429 Twine(InnerTag) +
" is not a valid tag number");
435 if (InnerValue >= strings.size()) {
438 Twine(InnerValue) +
" is not a valid " +
443 <<
" = " << InnerValue;
444 if (strings[InnerValue])
445 DescStream <<
" (" << strings[InnerValue] <<
')';
453 " cannot be recursively defined");
461 <<
" = " << InnerValue;
467 <<
" = " << InnerValue;
479 if (!Description.
empty()) {
486 return returnValue ? std::move(*returnValue) :
Error::
success();
489Error ARMAttributeParser::handler(
uint64_t tag,
bool &handled) {
491 for (
const auto &AH : displayRoutines) {
492 if (
uint64_t(AH.attribute) == tag) {
493 if (
Error e = (this->*AH.routine)(
static_cast<AttrType>(tag)))
#define ATTRIBUTE_HANDLER(attr)
static const char *const CPU_arch_strings[]
Given that RA is a live value
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
void setAttributeString(unsigned tag, StringRef value)
DataExtractor::Cursor cursor
Error parseStringAttribute(const char *name, unsigned tag, ArrayRef< const char * > strings)
void printAttribute(unsigned tag, unsigned value, StringRef valueDesc)
TagNameMap tagToStringMap
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
virtual void printString(StringRef Value)
void printStringEscaped(StringRef Label, StringRef Value)
virtual raw_ostream & startLine()
virtual void printNumber(StringRef Label, char Value)
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A raw_ostream that writes to an SmallVector or SmallString.
@ ABI_FP_optimization_goals
StringRef attrTypeAsString(unsigned attr, TagNameMap tagNameMap, bool hasTagPrefix=true)
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.