diff options
author | Sam McCall <sam.mccall@gmail.com> | 2019-11-28 19:22:50 +0100 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2019-11-29 11:00:01 +0100 |
commit | 407ac2eb5f136af5ddd213b8bcca176481ec5198 (patch) | |
tree | 48b8eeaada4099b094017e451f4933dc4b0480d4 /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 66ab932fcc10f4833cf16875d1e3dbcb81d9c39d (diff) | |
download | bcm5719-llvm-407ac2eb5f136af5ddd213b8bcca176481ec5198.tar.gz bcm5719-llvm-407ac2eb5f136af5ddd213b8bcca176481ec5198.zip |
[clangd] Log cc1 args at verbose level.
Summary: This will help debugging driver issues.
Reviewers: kbobyrev
Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70832
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index ab62b633cda..18c4814bbd5 100644 --- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -26,7 +26,8 @@ using namespace llvm::opt; std::unique_ptr<CompilerInvocation> clang::createInvocationFromCommandLine( ArrayRef<const char *> ArgList, IntrusiveRefCntPtr<DiagnosticsEngine> Diags, - IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS, bool ShouldRecoverOnErorrs) { + IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS, bool ShouldRecoverOnErorrs, + std::vector<std::string> *CC1Args) { if (!Diags.get()) { // No diagnostics engine was provided, so create our own diagnostics object // with the default options. @@ -89,6 +90,8 @@ std::unique_ptr<CompilerInvocation> clang::createInvocationFromCommandLine( } const ArgStringList &CCArgs = Cmd.getArguments(); + if (CC1Args) + *CC1Args = {CCArgs.begin(), CCArgs.end()}; auto CI = std::make_unique<CompilerInvocation>(); if (!CompilerInvocation::CreateFromArgs(*CI, CCArgs, *Diags) && !ShouldRecoverOnErorrs) |