summaryrefslogtreecommitdiff
path: root/external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2021-05-30 01:25:15 +0000
committerjoerg <joerg@NetBSD.org>2021-05-30 01:25:15 +0000
commit13fbcb42fff2606c3ce926a7c4bb8989aa18758c (patch)
treedcace6c89967106796d44b1a7c5e2269a20967e2 /external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parent13338e33506ade63440b4ba74479551bdc21c0f6 (diff)
Import clang 249b40b558955afe5ac2b549edcf2d7f859c8cc9.
Diffstat (limited to 'external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r--external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp11
1 files changed, 7 insertions, 4 deletions
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<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.
@@ -39,8 +40,8 @@ std::unique_ptr<CompilerInvocation> 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<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) &&
+ if (!CompilerInvocation::CreateFromArgs(*CI, CCArgs, *Diags, Args[0]) &&
!ShouldRecoverOnErorrs)
return nullptr;
return CI;