[clang] [llvm] Reapply "[RISCV][clang] Support XSfmm ABI attributes (#206260)" (PR #241642)
Alexis Engelke via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 15 23:28:19 PST 2026
================
@@ -0,0 +1,29 @@
+//=-- RISCVStateAttributes.h - Helper for interpreting RISC-V 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIB_TARGET_RISCV_RISCVSTATEATTRIBUTES_H
+#define LLVM_LIB_TARGET_RISCV_RISCVSTATEATTRIBUTES_H
+
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/IR/Function.h"
+
+namespace llvm {
+namespace RISCVState {
+
+inline constexpr StringLiteral Attributes[] = {
+ "riscv_in", "riscv_out", "riscv_inout", "riscv_preserves", "riscv_new"};
----------------
aengelke wrote:
Doesn't this cause dynamic relocations? Avoid arrays of StringRef/StringLiteral as per [our coding standards](https://llvm.org/docs/CodingStandards.html#avoid-pointers-in-global-static-constants).
https://github.com/llvm/llvm-project/pull/241642
More information about the cfe-commits
mailing list