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

Yingwei Zheng via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 22 19:19:56 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" ||
----------------
dtcxzyw wrote:

Should we accept `zero`?


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


More information about the cfe-commits mailing list