[PATCH] D151730: [RISCV] Support target attribute for function
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 19 19:04:24 PST 2023
craig.topper added inline comments.
================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:229
+collectNonISAExtFeature(const std::vector<std::string> &FeaturesVec, int XLen) {
+ auto I = llvm::find(FeaturesVec, "__RISCV_TargetAttrNeedOverride");
+ auto FeatureNeedOveride = std::vector<std::string>(FeaturesVec.begin(), I);
----------------
Do we need to call find again? We already did it in the caller, can we pass that information somehow?
================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:230
+ auto I = llvm::find(FeaturesVec, "__RISCV_TargetAttrNeedOverride");
+ auto FeatureNeedOveride = std::vector<std::string>(FeaturesVec.begin(), I);
+ auto ParseResult =
----------------
`std::vector<std::string> FeaturesNeedOverride(FeaturesVec.begin(), I);`
================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:243
+
+ for (auto Feat : FeatureNeedOveride) {
+ if (!llvm::is_contained(ImpliedFeatures, Feat))
----------------
`llvm::copy_if(FeatureNeedOveride, std::back_inserter(NonISAExtFeatureVec), [&](const std::string &Feat) { return !llvm::is_contained(ImpliedFeatures, Feat); });`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151730/new/
https://reviews.llvm.org/D151730
More information about the llvm-commits
mailing list