================ @@ -14270,9 +14270,16 @@ void ASTContext::getFunctionFeatureMap(llvm::StringMap<bool> &FeatureMap, Target->initFeatureMap(FeatureMap, getDiagnostics(), TargetCPU, Features); } } else if (const auto *TV = FD->getAttr<TargetVersionAttr>()) { - llvm::SmallVector<StringRef, 8> Feats; - TV->getFeatures(Feats); - std::vector<std::string> Features = getFMVBackendFeaturesFor(Feats); + std::vector<std::string> Features; + if (Target->getTriple().isRISCV()) { + ParsedTargetAttr ParsedAttr = Target->parseTargetAttr(TV->getName()); + Features.insert(Features.begin(), ParsedAttr.Features.begin(), + ParsedAttr.Features.end()); + } else { + llvm::SmallVector<StringRef, 8> Feats; ---------------- BeMg wrote:
Added. --- By the way, target_clones the similarly part use else for x86 target without the assert. https://github.com/llvm/llvm-project/blob/c3d3cef8d58377b02032b07b5f094a402a70435a/clang/lib/CodeGen/CodeGenModule.cpp#L4298. Should we add an assert as well? 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