@@ -518,7 +518,7 @@ void Writer::populateTargetFeatures() {
518
518
519
519
// Validate that used features are allowed in output
520
520
if (!inferFeatures) {
521
- for (auto &feature : used.keys ()) {
521
+ for (const auto &feature : used.keys ()) {
522
522
if (!allowed.count (std::string (feature)))
523
523
error (Twine (" Target feature '" ) + feature + " ' used by " +
524
524
used[feature] + " is not allowed." );
@@ -529,7 +529,7 @@ void Writer::populateTargetFeatures() {
529
529
for (ObjFile *file : symtab->objectFiles ) {
530
530
StringRef fileName (file->getName ());
531
531
SmallSet<std::string, 8 > objectFeatures;
532
- for (auto &feature : file->getWasmObj ()->getTargetFeatures ()) {
532
+ for (const auto &feature : file->getWasmObj ()->getTargetFeatures ()) {
533
533
if (feature.Prefix == WASM_FEATURE_PREFIX_DISALLOWED)
534
534
continue ;
535
535
objectFeatures.insert (feature.Name );
@@ -538,7 +538,7 @@ void Writer::populateTargetFeatures() {
538
538
fileName + " is disallowed by " + disallowed[feature.Name ] +
539
539
" . Use --no-check-features to suppress." );
540
540
}
541
- for (auto &feature : required.keys ()) {
541
+ for (const auto &feature : required.keys ()) {
542
542
if (!objectFeatures.count (std::string (feature)))
543
543
error (Twine (" Missing target feature '" ) + feature + " ' in " + fileName +
544
544
" , required by " + required[feature] +
0 commit comments