summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LibDriver/LibDriver.cpp4
-rw-r--r--llvm/lib/Option/OptTable.cpp7
2 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/LibDriver/LibDriver.cpp b/llvm/lib/LibDriver/LibDriver.cpp
index c9857b0493d..0b7c4756d0a 100644
--- a/llvm/lib/LibDriver/LibDriver.cpp
+++ b/llvm/lib/LibDriver/LibDriver.cpp
@@ -114,8 +114,8 @@ int llvm::libDriverMain(int Argc, const char **Argv) {
LibOptTable Table;
unsigned MissingIndex;
unsigned MissingCount;
- std::unique_ptr<llvm::opt::InputArgList> Args(
- Table.ParseArgs(&Argv[1], &Argv[Argc], MissingIndex, MissingCount));
+ std::unique_ptr<llvm::opt::InputArgList> Args(Table.ParseArgs(
+ makeArrayRef(Argv, Argc).slice(1), MissingIndex, MissingCount));
if (MissingCount) {
llvm::errs() << "missing arg value for \""
<< Args->getArgString(MissingIndex)
diff --git a/llvm/lib/Option/OptTable.cpp b/llvm/lib/Option/OptTable.cpp
index c37f193fa64..cec1717454f 100644
--- a/llvm/lib/Option/OptTable.cpp
+++ b/llvm/lib/Option/OptTable.cpp
@@ -247,18 +247,17 @@ Arg *OptTable::ParseOneArg(const ArgList &Args, unsigned &Index,
return new Arg(getOption(TheUnknownOptionID), Str, Index++, Str);
}
-InputArgList *OptTable::ParseArgs(const char *const *ArgBegin,
- const char *const *ArgEnd,
+InputArgList *OptTable::ParseArgs(ArrayRef<const char *> ArgArr,
unsigned &MissingArgIndex,
unsigned &MissingArgCount,
unsigned FlagsToInclude,
unsigned FlagsToExclude) const {
- InputArgList *Args = new InputArgList(ArgBegin, ArgEnd);
+ InputArgList *Args = new InputArgList(ArgArr.begin(), ArgArr.end());
// FIXME: Handle '@' args (or at least error on them).
MissingArgIndex = MissingArgCount = 0;
- unsigned Index = 0, End = ArgEnd - ArgBegin;
+ unsigned Index = 0, End = ArgArr.size();
while (Index < End) {
// Ingore nullptrs, they are response file's EOL markers
if (Args->getArgString(Index) == nullptr) {
OpenPOWER on IntegriCloud