зеркало из https://github.com/microsoft/clang-1.git
Driver: Ignore empty arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cb881672c2
Коммит
4139340644
|
@ -45,6 +45,16 @@ ArgList *Driver::ParseArgStrings(const char **ArgBegin, const char **ArgEnd) {
|
||||||
|
|
||||||
unsigned Index = 0, End = ArgEnd - ArgBegin;
|
unsigned Index = 0, End = ArgEnd - ArgBegin;
|
||||||
while (Index < End) {
|
while (Index < End) {
|
||||||
|
// gcc's handling of empty arguments doesn't make
|
||||||
|
// sense, but this is not a common use case. :)
|
||||||
|
//
|
||||||
|
// We just ignore them here (note that other things may
|
||||||
|
// still take them as arguments).
|
||||||
|
if (Args->getArgString(Index)[0] == '\0') {
|
||||||
|
++Index;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned Prev = Index;
|
unsigned Prev = Index;
|
||||||
Arg *A = getOpts().ParseOneArg(*Args, Index, End);
|
Arg *A = getOpts().ParseOneArg(*Args, Index, End);
|
||||||
if (A) {
|
if (A) {
|
||||||
|
@ -209,7 +219,7 @@ bool Driver::HandleImmediateArgs(const ArgList &Args) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Arg *A = Args.getLastArg(options::OPT_print_libgcc_file_name)) {
|
if (Args.hasArg(options::OPT_print_libgcc_file_name)) {
|
||||||
llvm::outs() << GetProgramPath("libgcc.a").toString() << "\n";
|
llvm::outs() << GetProgramPath("libgcc.a").toString() << "\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче