[clang] [RISCV] Implement validateGlobalRegisterVariable. (PR #109596)

Pengcheng Wang via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 22 21:47:06 PDT 2024


================
@@ -486,3 +486,15 @@ bool RISCVTargetInfo::validateCpuSupports(StringRef Feature) const {
 bool RISCVTargetInfo::isValidFeatureName(StringRef Name) const {
   return llvm::RISCVISAInfo::isSupportedExtensionFeature(Name);
 }
+
+bool RISCVTargetInfo::validateGlobalRegisterVariable(
+    StringRef RegName, unsigned RegSize, bool &HasSizeMismatch) const {
+  if (RegName == "ra" || RegName == "sp" || RegName == "gp" ||
----------------
wangpc-pp wrote:

`zero` is not writable/allocatable?

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


More information about the cfe-commits mailing list