================ @@ -0,0 +1,140 @@ +//===-- AArch64BuildAttributes.cpp - AArch64 Build Attributes -------------===// +// +// 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/Support/AArch64BuildAttributes.h" + +namespace llvm { +namespace AArch64BuildAttributes { +// AArch64 build attributes +StringRef getSubsectionTag() { return "aeabi_subsection"; } +StringRef getAttrTag() { return "aeabi_attribute"; } + +StringRef getVendorName(unsigned Vendor) { + switch (Vendor) { + case AEABI_FEATURE_AND_BITS: + return VendorName[AEABI_FEATURE_AND_BITS]; + case AEABI_PAUTHABI: + return VendorName[AEABI_PAUTHABI]; + case VENDOR_UNKNOWN: + return ""; + default: + assert(0 && "Vendor name error"); + return ""; + } +} +VendorID getVendorID(StringRef Vendor) { + if (Vendor == VendorName[AEABI_FEATURE_AND_BITS]) { ---------------- ostannard wrote:
For the string->enum functions, you can use `llvm::StringSwitch`: https://llvm.org/doxygen/classllvm_1_1StringSwitch.html https://github.com/llvm/llvm-project/pull/118771 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits