From 519fc96c475680de2cc49e7811dbbfadb912cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:09 +0000 Subject: Vendor import of stripped clang trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/cfe/trunk@375505 --- lib/Frontend/CreateInvocationFromCommandLine.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lib/Frontend/CreateInvocationFromCommandLine.cpp') diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index b62416ffd9e7..ab62b633cda3 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/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 clang::createInvocationFromCommandLine( ArrayRef ArgList, IntrusiveRefCntPtr Diags, - IntrusiveRefCntPtr VFS) { + IntrusiveRefCntPtr 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 clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); - auto CI = llvm::make_unique(); - if (!CompilerInvocation::CreateFromArgs(*CI, - const_cast(CCArgs.data()), - const_cast(CCArgs.data()) + - CCArgs.size(), - *Diags)) + auto CI = std::make_unique(); + if (!CompilerInvocation::CreateFromArgs(*CI, CCArgs, *Diags) && + !ShouldRecoverOnErorrs) return nullptr; return CI; } -- cgit v1.2.3