From: Aaron Ballman Date: Mon, 11 May 2015 13:10:17 +0000 (+0000) Subject: Replacing a range-based for loop with an old-style for loop. This code was previously... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9ffcd1bdbd18149dbb17d01f868ffd5558eae8d7;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236990 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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.