[clang] [Clang][RISCV] Recognize unsupport target feature by supporting isValidFeatureName (PR #106495)
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 5 17:28:24 PDT 2024
================
@@ -2993,10 +2993,17 @@ bool Sema::checkTargetAttr(SourceLocation LiteralLoc, StringRef AttrStr) {
return Diag(LiteralLoc, diag::warn_unsupported_target_attribute)
<< Unknown << Tune << ParsedAttrs.Tune << Target;
- if (Context.getTargetInfo().getTriple().isRISCV() &&
- ParsedAttrs.Duplicate != "")
- return Diag(LiteralLoc, diag::err_duplicate_target_attribute)
- << Duplicate << None << ParsedAttrs.Duplicate << Target;
+ if (Context.getTargetInfo().getTriple().isRISCV()) {
+ if (ParsedAttrs.Duplicate != "")
+ return Diag(LiteralLoc, diag::err_duplicate_target_attribute)
+ << Duplicate << None << ParsedAttrs.Duplicate << Target;
+ for (const auto &Feature : ParsedAttrs.Features) {
+ auto CurFeature = StringRef(Feature);
----------------
topperc wrote:
Does `StringRef CurFeature = Feature` work?
https://github.com/llvm/llvm-project/pull/106495
More information about the cfe-commits
mailing list