summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-06-30 13:21:27 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-06-30 13:21:27 +0000
commitf5f1f63df1b65b19c63a06ff10921f08ce043a81 (patch)
tree85c7a2b50501fdb16819f98dbd4a0fbcf988f6ac /tools
parent0c223be753a86df1bef5ace82e5a3e11020c026c (diff)
[Driver] Actually report errors during parsing instead of stopping when there's an error somewhere.
This is a more principled version of r303756. That change was both very brittle about the state of the Diags object going into the driver and also broke tooling in funny ways. In particular it prevented tools from capturing diagnostics properly and made the compilation database logic fail to provide arguments to the tool, falling back to scanning directories for JSON files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/driver/driver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index af25d95980..9f37c428ff 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -462,7 +462,7 @@ int main(int argc_, const char **argv_) {
std::unique_ptr<Compilation> C(TheDriver.BuildCompilation(argv));
int Res = 1;
- if (C.get()) {
+ if (C && !C->containsError()) {
SmallVector<std::pair<int, const Command *>, 4> FailingCommands;
Res = TheDriver.ExecuteCompilation(*C, FailingCommands);