Skip to content

Commit

Permalink
Replacing a range-based for loop with an old-style for loop. This cod…
Browse files Browse the repository at this point in the history
…e 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
  • Loading branch information
AaronBallman committed May 11, 2015
1 parent fe78d29 commit 9ffcd1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions unittests/Support/TargetRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9ffcd1b

Please sign in to comment.