[llvm] r300139 - Fix some ArgList uses after API change in r300135.
Richard Smith via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 16:43:58 PDT 2017
Author: rsmith
Date: Wed Apr 12 18:43:58 2017
New Revision: 300139
URL: http://llvm.org/viewvc/llvm-project?rev=300139&view=rev
Log:
Fix some ArgList uses after API change in r300135.
Modified:
llvm/trunk/lib/LibDriver/LibDriver.cpp
llvm/trunk/unittests/Option/OptionParsingTest.cpp
Modified: llvm/trunk/lib/LibDriver/LibDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LibDriver/LibDriver.cpp?rev=300139&r1=300138&r2=300139&view=diff
==============================================================================
--- llvm/trunk/lib/LibDriver/LibDriver.cpp (original)
+++ llvm/trunk/lib/LibDriver/LibDriver.cpp Wed Apr 12 18:43:58 2017
@@ -121,7 +121,7 @@ int llvm::libDriverMain(llvm::ArrayRef<c
for (auto *Arg : Args.filtered(OPT_UNKNOWN))
llvm::errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n";
- if (Args.filtered_begin(OPT_INPUT) == Args.filtered_end()) {
+ if (!Args.hasArgNoClaim(OPT_INPUT)) {
// No input files. To match lib.exe, silently do nothing.
return 0;
}
Modified: llvm/trunk/unittests/Option/OptionParsingTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Option/OptionParsingTest.cpp?rev=300139&r1=300138&r2=300139&view=diff
==============================================================================
--- llvm/trunk/unittests/Option/OptionParsingTest.cpp (original)
+++ llvm/trunk/unittests/Option/OptionParsingTest.cpp Wed Apr 12 18:43:58 2017
@@ -97,11 +97,11 @@ TEST(Option, OptionParsing) {
EXPECT_NE(std::string::npos, Help.find("-A"));
// Test aliases.
- arg_iterator Cs = AL.filtered_begin(OPT_C);
- ASSERT_NE(AL.filtered_end(), Cs);
- EXPECT_EQ("desu", StringRef((*Cs)->getValue()));
+ auto Cs = AL.filtered(OPT_C);
+ ASSERT_NE(Cs.begin(), Cs.end());
+ EXPECT_EQ("desu", StringRef((*Cs.begin())->getValue()));
ArgStringList ASL;
- (*Cs)->render(AL, ASL);
+ (*Cs.begin())->render(AL, ASL);
ASSERT_EQ(2u, ASL.size());
EXPECT_EQ("-C", StringRef(ASL[0]));
EXPECT_EQ("desu", StringRef(ASL[1]));
More information about the llvm-commits
mailing list