summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-05-11 13:10:17 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-05-11 13:10:17 +0000
commit73cb576c35bd1368e00a2160f2cd935d70908e23 (patch)
tree403fcbc61fb86b8c30c92fdb696da593056eee4a
parent3c1d5727998d40a712293cfd8fd9a071ce4c6949 (diff)
downloadbcm5719-llvm-73cb576c35bd1368e00a2160f2cd935d70908e23.tar.gz
bcm5719-llvm-73cb576c35bd1368e00a2160f2cd935d70908e23.zip
Replacing a range-based for loop with an old-style for loop. This code was previously causing a warning with MSVC about a compiler-generated local variable because TargetRegistry::begin() and end() are static member functions. NFC.
llvm-svn: 236990
-rw-r--r--llvm/unittests/Support/TargetRegistry.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/unittests/Support/TargetRegistry.cpp b/llvm/unittests/Support/TargetRegistry.cpp
index dd5ef431ae0..7738e524094 100644
--- a/llvm/unittests/Support/TargetRegistry.cpp
+++ b/llvm/unittests/Support/TargetRegistry.cpp
@@ -23,8 +23,9 @@ TEST(TargetRegistry, TargetHasArchType) {
llvm::InitializeAllTargetInfos();
llvm::TargetRegistry RegistryRoot;
- for (const auto &Target : RegistryRoot) {
- StringRef Name = Target.getName();
+ for (auto &I = TargetRegistry::begin(), &E = TargetRegistry::end();
+ I != E; ++I) {
+ StringRef Name = I->getName();
// There is really no way (at present) to ask a Target whether it targets
// a specific architecture, because the logic for that is buried in a
// predicate.
OpenPOWER on IntegriCloud