@@ -236,8 +236,7 @@ ArrayRef<Builtin::Info> RISCVTargetInfo::getTargetBuiltins() const {
236
236
}
237
237
238
238
static std::vector<std::string>
239
- collectNonISAExtFeature (const std::vector<std::string> &FeaturesNeedOverride,
240
- int XLen) {
239
+ collectNonISAExtFeature (ArrayRef<std::string> FeaturesNeedOverride, int XLen) {
241
240
auto ParseResult =
242
241
llvm::RISCVISAInfo::parseFeatures (XLen, FeaturesNeedOverride);
243
242
@@ -265,11 +264,11 @@ resolveTargetAttrOverride(const std::vector<std::string> &FeaturesVec,
265
264
if (I == FeaturesVec.end ())
266
265
return FeaturesVec;
267
266
268
- const std::vector <std::string> FeaturesNeedOverride (FeaturesVec.begin (), I);
267
+ ArrayRef <std::string> FeaturesNeedOverride (&* FeaturesVec.begin (), &* I);
269
268
std::vector<std::string> NonISAExtFeature =
270
269
collectNonISAExtFeature (FeaturesNeedOverride, XLen);
271
270
272
- auto ResolvedFeature = std::vector<std::string>(++I, FeaturesVec.end ());
271
+ std::vector<std::string> ResolvedFeature (++I, FeaturesVec.end ());
273
272
ResolvedFeature.insert (ResolvedFeature.end (), NonISAExtFeature.begin (),
274
273
NonISAExtFeature.end ());
275
274
@@ -415,8 +414,7 @@ static void handleFullArchString(StringRef FullArchStr,
415
414
Features.push_back (" +" + FullArchStr.str ());
416
415
} else {
417
416
std::vector<std::string> FeatStrings = (*RII)->toFeatureVector ();
418
- for (auto FeatString : FeatStrings)
419
- Features.push_back (FeatString);
417
+ Features.insert (Features.end (), FeatStrings.begin (), FeatStrings.end ());
420
418
}
421
419
}
422
420
0 commit comments