summaryrefslogtreecommitdiff
path: root/external/apache2/llvm/dist/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
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;