Pass in Args.size() - 1, not Args.size() so the nullptr arg is not included in "argc".

Swift SVN r13762
This commit is contained in:
Michael Gottesman
2014-02-10 22:58:51 +00:00
parent f88bc1ed3e
commit 648d3fee40

View File

@@ -48,7 +48,7 @@ bool swift::CompilerInstance::setup(const CompilerInvocation &Invok) {
++i)
Args.push_back(Invok.getFrontendOptions().LLVMArgs[i].c_str());
Args.push_back(nullptr);
llvm::cl::ParseCommandLineOptions(Args.size(), Args.data());
llvm::cl::ParseCommandLineOptions(Args.size()-1, Args.data());
}
Context.reset(new ASTContext(Invocation.getLangOptions(),