diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-06-30 13:21:27 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-06-30 13:21:27 +0000 |
commit | f5f1f63df1b65b19c63a06ff10921f08ce043a81 (patch) | |
tree | 85c7a2b50501fdb16819f98dbd4a0fbcf988f6ac /tools | |
parent | 0c223be753a86df1bef5ace82e5a3e11020c026c (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.cpp | 2 |
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); |