From 8dc7b982b4556c243e0502e6e230bdd53ddd65ff Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 1 Jan 2020 17:23:21 +0100 Subject: [NFC] Fixes -Wrange-loop-analysis warnings This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857 --- llvm/lib/Support/CommandLine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Support/CommandLine.cpp') diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index e4e2f005543..cb73380ba38 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/lib/Support/CommandLine.cpp @@ -187,7 +187,7 @@ public: // If we're adding this to all sub-commands, add it to the ones that have // already been registered. if (SC == &*AllSubCommands) { - for (const auto &Sub : RegisteredSubCommands) { + for (auto *Sub : RegisteredSubCommands) { if (SC == Sub) continue; addLiteralOption(Opt, Sub, Name); @@ -243,7 +243,7 @@ public: // If we're adding this to all sub-commands, add it to the ones that have // already been registered. if (SC == &*AllSubCommands) { - for (const auto &Sub : RegisteredSubCommands) { + for (auto *Sub : RegisteredSubCommands) { if (SC == Sub) continue; addOption(O, Sub); @@ -318,7 +318,7 @@ public: } bool hasOptions() const { - for (const auto &S : RegisteredSubCommands) { + for (const auto *S : RegisteredSubCommands) { if (hasOptions(*S)) return true; } @@ -2112,7 +2112,7 @@ static void sortOpts(StringMap