summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-11-18 16:14:27 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-11-18 16:14:27 +0000
commitc02670ed50f009eeb24ad7f0fe00cbf887e008d0 (patch)
tree91534d89cfdf7ec6423ed88a229c34a6b088160c /clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
parent4ba4816b9701aecbc757f7d806895e114908f309 (diff)
downloadbcm5719-llvm-c02670ed50f009eeb24ad7f0fe00cbf887e008d0.tar.gz
bcm5719-llvm-c02670ed50f009eeb24ad7f0fe00cbf887e008d0.zip
[libclang] Add entry points that take a full command line including argv[0].
This provides both a more uniform interface and makes libclang behave like clang tooling wrt relative paths against argv[0]. This is necessary for finding paths to a c++ standard library relative to a clang binary given in a compilation database. It can also be used to find paths relative to libclang.so if the full path to it is passed in. Differential Revision: http://reviews.llvm.org/D14695 llvm-svn: 253466
Diffstat (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r--clang/lib/Frontend/CreateInvocationFromCommandLine.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
index 2afd23fcb9e..30191642256 100644
--- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
+++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp
@@ -39,15 +39,13 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions);
}
- SmallVector<const char *, 16> Args;
- Args.push_back("<clang>"); // FIXME: Remove dummy argument.
- Args.insert(Args.end(), ArgList.begin(), ArgList.end());
+ SmallVector<const char *, 16> Args(ArgList.begin(), ArgList.end());
// FIXME: Find a cleaner way to force the driver into restricted modes.
Args.push_back("-fsyntax-only");
// FIXME: We shouldn't have to pass in the path info.
- driver::Driver TheDriver("clang", llvm::sys::getDefaultTargetTriple(),
+ driver::Driver TheDriver(Args[0], llvm::sys::getDefaultTargetTriple(),
*Diags);
// Don't check that inputs exist, they may have been remapped.
OpenPOWER on IntegriCloud