From fcf4e360ba6b5f005d2c478ca79112be7a61dacb Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 4 Dec 2022 18:36:41 +0100 Subject: Iterate over StringMaps using structured bindings. NFCI. --- llvm/lib/CodeGen/CommandFlags.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/CommandFlags.cpp') diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp index 68041f9ddef6..9ad7c350a959 100644 --- a/llvm/lib/CodeGen/CommandFlags.cpp +++ b/llvm/lib/CodeGen/CommandFlags.cpp @@ -592,8 +592,8 @@ std::string codegen::getFeaturesStr() { if (getMCPU() == "native") { StringMap HostFeatures; if (sys::getHostCPUFeatures(HostFeatures)) - for (auto &F : HostFeatures) - Features.AddFeature(F.first(), F.second); + for (const auto &[Feature, IsEnabled] : HostFeatures) + Features.AddFeature(Feature, IsEnabled); } for (auto const &MAttr : getMAttrs()) @@ -612,8 +612,8 @@ std::vector codegen::getFeatureList() { if (getMCPU() == "native") { StringMap HostFeatures; if (sys::getHostCPUFeatures(HostFeatures)) - for (auto &F : HostFeatures) - Features.AddFeature(F.first(), F.second); + for (const auto &[Feature, IsEnabled] : HostFeatures) + Features.AddFeature(Feature, IsEnabled); } for (auto const &MAttr : getMAttrs()) -- cgit v1.2.3