diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-13 01:01:44 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-13 01:01:44 +0000 |
commit | 0f35a026a965f7f44c339bebab99cdb9bb277fdd (patch) | |
tree | e7afee9609ee58c177232dce848ca6e9a50be7b4 /clang/lib/Driver/Driver.cpp | |
parent | 5e0f6af190fadc064d64f42e56da6cff6081b86d (diff) | |
download | bcm5719-llvm-0f35a026a965f7f44c339bebab99cdb9bb277fdd.tar.gz bcm5719-llvm-0f35a026a965f7f44c339bebab99cdb9bb277fdd.zip |
Driver: Ignore empty arguments.
llvm-svn: 66858
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index c8750f7449b..4fc03ce7659 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -45,6 +45,16 @@ ArgList *Driver::ParseArgStrings(const char **ArgBegin, const char **ArgEnd) { unsigned Index = 0, End = ArgEnd - ArgBegin; 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; Arg *A = getOpts().ParseOneArg(*Args, Index, End); if (A) { @@ -209,7 +219,7 @@ bool Driver::HandleImmediateArgs(const ArgList &Args) { 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"; return false; } |