diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-22 21:31:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-22 21:31:48 +0000 |
commit | a7dea1671b87c07d2d266f836bfa8b58efc7c134 (patch) | |
tree | ff67344b3b18fc14e0cec322849afb4e3b94ea56 /contrib/llvm-project/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 5c713029ff7939f90b6f96df914953e758855a7f (diff) | |
parent | 519fc96c475680de2cc49e7811dbbfadb912cbcc (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/contrib/llvm-project/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/contrib/llvm-project/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index b62416ffd9e7..ab62b633cda3 100644 --- a/contrib/llvm-project/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/contrib/llvm-project/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -24,14 +24,9 @@ using namespace clang; using namespace llvm::opt; -/// createInvocationFromCommandLine - Construct a compiler invocation object for -/// a command line argument vector. -/// -/// \return A CompilerInvocation, or 0 if none was built for the given -/// argument vector. std::unique_ptr<CompilerInvocation> clang::createInvocationFromCommandLine( ArrayRef<const char *> ArgList, IntrusiveRefCntPtr<DiagnosticsEngine> Diags, - IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) { + IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS, bool ShouldRecoverOnErorrs) { if (!Diags.get()) { // No diagnostics engine was provided, so create our own diagnostics object // with the default options. @@ -94,12 +89,9 @@ std::unique_ptr<CompilerInvocation> clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); - auto CI = llvm::make_unique<CompilerInvocation>(); - if (!CompilerInvocation::CreateFromArgs(*CI, - const_cast<const char **>(CCArgs.data()), - const_cast<const char **>(CCArgs.data()) + - CCArgs.size(), - *Diags)) + auto CI = std::make_unique<CompilerInvocation>(); + if (!CompilerInvocation::CreateFromArgs(*CI, CCArgs, *Diags) && + !ShouldRecoverOnErorrs) return nullptr; return CI; } |