[clang] [llvm] [RISCV][clang] Support XSfmm ABI attributes (PR #206260)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 11:00:08 PDT 2026


================
@@ -12,13 +12,34 @@
 
 #include "RISCVCallingConv.h"
 #include "RISCVMachineFunctionInfo.h"
+#include "RISCVStateAttributes.h"
 #include "RISCVSubtarget.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Module.h"
 #include "llvm/MC/MCRegister.h"
 
 using namespace llvm;
 
+void llvm::checkRISCVStateCall(const Function &Caller, StringRef CalleeName) {
+  if (!RISCVState::hasAttribute(Caller))
+    return;
+
+  std::string Message = (Caller.getName() + ": cannot emit call to '" +
+                         CalleeName + "' from an RISC-V attributed function.")
----------------
topperc wrote:

```suggestion
                         CalleeName + "' from a RISC-V attributed function.")
```

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


More information about the cfe-commits mailing list