diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2015-08-12 13:38:59 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2015-08-12 13:38:59 +0000 |
commit | b226d3d0da78f5f619e1e601b2783e0d48f46fdf (patch) | |
tree | 7751dbb545212200eeb970dcb6fc2261ee0f8214 /clang/lib/Basic | |
parent | 0bef27d836f2021befadc786d44bab32f066ffbd (diff) | |
download | bcm5719-llvm-b226d3d0da78f5f619e1e601b2783e0d48f46fdf.tar.gz bcm5719-llvm-b226d3d0da78f5f619e1e601b2783e0d48f46fdf.zip |
Rangify some for loops; NFC.
llvm-svn: 244749
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r-- | clang/lib/Basic/Targets.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index fa736bcfed2..9756b0577c4 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/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<bool>::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; |