diff --git a/unittests/Support/TargetRegistry.cpp b/unittests/Support/TargetRegistry.cpp index dd5ef431ae0..7738e524094 100644 --- a/unittests/Support/TargetRegistry.cpp +++ b/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.