================
@@ -3056,6 +3056,45 @@ bool Sema::checkTargetVersionAttr(SourceLocation 
LiteralLoc, Decl *D,
   enum SecondParam { None };
   enum ThirdParam { Target, TargetClones, TargetVersion };
   llvm::SmallVector<StringRef, 8> Features;
+  if (Context.getTargetInfo().getTriple().isRISCV()) {
+
+    llvm::SmallVector<StringRef, 8> AttrStrs;
+    AttrStr.split(AttrStrs, ';');
+
+    bool IsPriority = false;
+    bool IsDefault = false;
+    for (auto &AttrStr : AttrStrs) {
+      // Only support arch=+ext,... syntax.
----------------
BeMg wrote:

The line `arch=rv64gc` will trigger a warning because it currently doesn't 
support the full architecture.

`unsupported 'arch=rv64gcv' in the 'target_version' attribute string; 
'target_version' attribute ignored`

https://github.com/llvm/llvm-project/blob/b89211cdd27474469b4e6ca1206c12892a85974b/clang/lib/Sema/SemaDeclAttr.cpp#L3089

`target_version("arch=+c;default")` has already new `HasArch` guard, and it 
also emit the warning.

`unsupported 'arch=+c;default' in the 'target_version' attribute string; 
'target_version' attribute ignored`

https://github.com/llvm/llvm-project/pull/99040
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to