r244749 - Rangify some for loops; NFC.
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 12 06:38:59 PDT 2015
Author: aaronballman
Date: Wed Aug 12 08:38:59 2015
New Revision: 244749
URL: http://llvm.org/viewvc/llvm-project?rev=244749&view=rev
Log:
Rangify some for loops; NFC.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=244749&r1=244748&r2=244749&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Aug 12 08:38:59 2015
@@ -7540,9 +7540,8 @@ TargetInfo::CreateTargetInfo(Diagnostics
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(Diagnostics
// 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;
More information about the cfe-commits
mailing list