summaryrefslogtreecommitdiffstats
path: root/tools/diagtool
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
commitb1dfd660998cc98c27541047a6f255808c232d62 (patch)
tree3b5989a86a26a44c538d3866940247cbe58f4180 /tools/diagtool
parent980d9c87b942f16521e39fd308bdc7f6aef78da2 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/diagtool')
-rw-r--r--tools/diagtool/ShowEnabledWarnings.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/diagtool/ShowEnabledWarnings.cpp b/tools/diagtool/ShowEnabledWarnings.cpp
index 06f74320b7..abbd3afbd5 100644
--- a/tools/diagtool/ShowEnabledWarnings.cpp
+++ b/tools/diagtool/ShowEnabledWarnings.cpp
@@ -64,9 +64,11 @@ createDiagnostics(unsigned int argc, char **argv) {
new DiagnosticsEngine(DiagIDs, new DiagnosticOptions(), DiagsBuffer));
// Try to build a CompilerInvocation.
+ SmallVector<const char *, 4> Args;
+ Args.push_back("diagtool");
+ Args.append(argv, argv + argc);
std::unique_ptr<CompilerInvocation> Invocation(
- createInvocationFromCommandLine(llvm::makeArrayRef(argv, argc),
- InterimDiags));
+ createInvocationFromCommandLine(Args, InterimDiags));
if (!Invocation)
return nullptr;