@@ -572,7 +572,6 @@ void Writer::finalizeSections() {
572572
573573void Writer::populateTargetFeatures () {
574574 StringMap<std::string> used;
575- StringMap<std::string> required;
576575 StringMap<std::string> disallowed;
577576 SmallSet<std::string, 8 > &allowed = out.targetFeaturesSec ->features ;
578577 bool tlsUsed = false ;
@@ -599,18 +598,14 @@ void Writer::populateTargetFeatures() {
599598 goto done;
600599 }
601600
602- // Find the sets of used, required, and disallowed features
601+ // Find the sets of used and disallowed features
603602 for (ObjFile *file : ctx.objectFiles ) {
604603 StringRef fileName (file->getName ());
605604 for (auto &feature : file->getWasmObj ()->getTargetFeatures ()) {
606605 switch (feature.Prefix ) {
607606 case WASM_FEATURE_PREFIX_USED:
608607 used.insert ({feature.Name , std::string (fileName)});
609608 break ;
610- case WASM_FEATURE_PREFIX_REQUIRED:
611- used.insert ({feature.Name , std::string (fileName)});
612- required.insert ({feature.Name , std::string (fileName)});
613- break ;
614609 case WASM_FEATURE_PREFIX_DISALLOWED:
615610 disallowed.insert ({feature.Name , std::string (fileName)});
616611 break ;
@@ -662,7 +657,7 @@ void Writer::populateTargetFeatures() {
662657 }
663658 }
664659
665- // Validate the required and disallowed constraints for each file
660+ // Validate the disallowed constraints for each file
666661 for (ObjFile *file : ctx.objectFiles ) {
667662 StringRef fileName (file->getName ());
668663 SmallSet<std::string, 8 > objectFeatures;
@@ -675,12 +670,6 @@ void Writer::populateTargetFeatures() {
675670 fileName + " is disallowed by " + disallowed[feature.Name ] +
676671 " . Use --no-check-features to suppress." );
677672 }
678- for (const auto &feature : required.keys ()) {
679- if (!objectFeatures.count (std::string (feature)))
680- error (Twine (" Missing target feature '" ) + feature + " ' in " + fileName +
681- " , required by " + required[feature] +
682- " . Use --no-check-features to suppress." );
683- }
684673 }
685674
686675done:
0 commit comments