[lld] 9d22754 - Fix lld build after 5881dcff7e76a68

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 12:07:18 PDT 2021


Author: Nico Weber
Date: 2021-09-02T15:07:10-04:00
New Revision: 9d227543890e721b95303430ee1427ce5aa7292f

URL: https://github.com/llvm/llvm-project/commit/9d227543890e721b95303430ee1427ce5aa7292f
DIFF: https://github.com/llvm/llvm-project/commit/9d227543890e721b95303430ee1427ce5aa7292f.diff

LOG: Fix lld build after 5881dcff7e76a68

Added: 
    

Modified: 
    lld/wasm/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 2d4dc472834ae..82a2499081fb8 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -518,7 +518,7 @@ void Writer::populateTargetFeatures() {
 
   // Validate that used features are allowed in output
   if (!inferFeatures) {
-    for (auto &feature : used.keys()) {
+    for (const auto &feature : used.keys()) {
       if (!allowed.count(std::string(feature)))
         error(Twine("Target feature '") + feature + "' used by " +
               used[feature] + " is not allowed.");
@@ -529,7 +529,7 @@ void Writer::populateTargetFeatures() {
   for (ObjFile *file : symtab->objectFiles) {
     StringRef fileName(file->getName());
     SmallSet<std::string, 8> objectFeatures;
-    for (auto &feature : file->getWasmObj()->getTargetFeatures()) {
+    for (const auto &feature : file->getWasmObj()->getTargetFeatures()) {
       if (feature.Prefix == WASM_FEATURE_PREFIX_DISALLOWED)
         continue;
       objectFeatures.insert(feature.Name);
@@ -538,7 +538,7 @@ void Writer::populateTargetFeatures() {
               fileName + " is disallowed by " + disallowed[feature.Name] +
               ". Use --no-check-features to suppress.");
     }
-    for (auto &feature : required.keys()) {
+    for (const auto &feature : required.keys()) {
       if (!objectFeatures.count(std::string(feature)))
         error(Twine("Missing target feature '") + feature + "' in " + fileName +
               ", required by " + required[feature] +


        


More information about the llvm-commits mailing list