Readdress r236990, use of static members on a non-static variable.
[oota-llvm.git] / unittests / Support / TargetRegistry.cpp
index 2dd57fa7bf186a0cc5f9759d3fc3c596f7535531..ae89c8b6493038bfd67c63a885771a5d031bbfc7 100644 (file)
@@ -22,9 +22,8 @@ TEST(TargetRegistry, TargetHasArchType) {
 
   llvm::InitializeAllTargetInfos();
 
-  for (auto I = TargetRegistry::begin(), E = TargetRegistry::end();
-       I != E; ++I) {
-    StringRef Name = I->getName();
+  for (const Target &T : TargetRegistry::targets()) {
+    StringRef Name = T.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.