From: Aaron Ballman Date: Wed, 12 Aug 2015 13:38:59 +0000 (+0000) Subject: Rangify some for loops; NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f97e22e09a49061ae160a3add6329b3eb41e90e4;p=clang Rangify some for loops; NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244749 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index fa736bcfed..9756b0577c 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -7540,9 +7540,8 @@ TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags, Target->getDefaultFeatures(Features); // Apply the user specified deltas. - for (unsigned I = 0, N = Opts->FeaturesAsWritten.size(); - I < N; ++I) { - const char *Name = Opts->FeaturesAsWritten[I].c_str(); + for (const auto &F : Opts->FeaturesAsWritten) { + const char *Name = F.c_str(); // Apply the feature via the target. bool Enabled = Name[0] == '+'; Target->setFeatureEnabled(Features, Name + 1, Enabled); @@ -7553,9 +7552,9 @@ TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags, // FIXME: If we are completely confident that we have the right set, we only // need to pass the minuses. Opts->Features.clear(); - for (llvm::StringMap::const_iterator it = Features.begin(), - ie = Features.end(); it != ie; ++it) - Opts->Features.push_back((it->second ? "+" : "-") + it->first().str()); + for (const auto &F : Features) + Opts->Features.push_back((F.getValue() ? "+" : "-") + F.getKey().str()); + if (!Target->handleTargetFeatures(Opts->Features, Diags)) return nullptr;