[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)

Piyou Chen via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 00:45:22 PDT 2024


================
@@ -391,7 +391,14 @@ void RISCVTargetInfo::fillValidTuneCPUList(
 
 static void handleFullArchString(StringRef FullArchStr,
                                  std::vector<std::string> &Features) {
-  Features.push_back("__RISCV_TargetAttrNeedOverride");
+
+  // Should be full arch string.
+  if (!FullArchStr.starts_with("rv")) {
+    Features.push_back(FullArchStr.str());
----------------
BeMg wrote:

Oh, I found the `parseArchString` also check whether FullArchStr start with "rv". 

I removed this statement and drop the unnecessary "+" sign to trigger the Sema check.

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


More information about the cfe-commits mailing list