[clang] [llvm] [LLVM][Clang][AArch64] Implement AArch64 build attributes (PR #118771)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 13 11:16:19 PST 2025


================
@@ -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:
----------------
sivan-shani wrote:

The array is useful when referring to those string from elsewhere, avoiding possible typos.
e.g. in
`AArch64AsmPrinter::emitAttributes`
`AArch64AsmParser::parseDirectiveAeabiAArch64Attr`

https://github.com/llvm/llvm-project/pull/118771


More information about the cfe-commits mailing list