From 9d227543890e721b95303430ee1427ce5aa7292f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 2 Sep 2021 15:06:43 -0400 Subject: [PATCH] Fix lld build after 5881dcff7e76a68 --- lld/wasm/Writer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp index 2d4dc47..82a2499 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 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] + -- 2.7.4