From 13fbcb42fff2606c3ce926a7c4bb8989aa18758c Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 30 May 2021 01:25:15 +0000 Subject: Import clang 249b40b558955afe5ac2b549edcf2d7f859c8cc9. --- .../clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp') diff --git a/external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index ab62b633cda..ff0aa6faf33 100644 --- a/external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -26,7 +26,8 @@ using namespace llvm::opt; std::unique_ptr clang::createInvocationFromCommandLine( ArrayRef ArgList, IntrusiveRefCntPtr Diags, - IntrusiveRefCntPtr VFS, bool ShouldRecoverOnErorrs) { + IntrusiveRefCntPtr VFS, bool ShouldRecoverOnErorrs, + std::vector *CC1Args) { if (!Diags.get()) { // No diagnostics engine was provided, so create our own diagnostics object // with the default options. @@ -39,8 +40,8 @@ std::unique_ptr clang::createInvocationFromCommandLine( Args.push_back("-fsyntax-only"); // FIXME: We shouldn't have to pass in the path info. - driver::Driver TheDriver(Args[0], llvm::sys::getDefaultTargetTriple(), - *Diags, VFS); + driver::Driver TheDriver(Args[0], llvm::sys::getDefaultTargetTriple(), *Diags, + "clang LLVM compiler", VFS); // Don't check that inputs exist, they may have been remapped. TheDriver.setCheckInputsExist(false); @@ -89,8 +90,10 @@ std::unique_ptr clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); + if (CC1Args) + *CC1Args = {CCArgs.begin(), CCArgs.end()}; auto CI = std::make_unique(); - if (!CompilerInvocation::CreateFromArgs(*CI, CCArgs, *Diags) && + if (!CompilerInvocation::CreateFromArgs(*CI, CCArgs, *Diags, Args[0]) && !ShouldRecoverOnErorrs) return nullptr; return CI; -- cgit