Fix some ArgList uses after API change in r300135.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300139 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Smith 2017-04-12 23:43:58 +00:00
parent 71cd6a6292
commit e22326d7b4
2 changed files with 5 additions and 5 deletions

View File

@ -121,7 +121,7 @@ int llvm::libDriverMain(llvm::ArrayRef<const char*> ArgsArr) {
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;
}

View File

@ -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]));