aboutsummaryrefslogtreecommitdiff
path: root/src/zig_clang_cc1_main.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-07-10 03:06:05 -0400
committerGitHub <noreply@github.com>2022-07-10 03:06:05 -0400
commitb88151e0e1553607cbebc197e1111ec4bf53a595 (patch)
treecd4f57feae521500fe4eb99a98a798241256d341 /src/zig_clang_cc1_main.cpp
parent3f11d1d56d9747de974b00eab1c880bea7972c01 (diff)
parentf9bf4889264aee387639bb8a35fdf594236b1283 (diff)
downloadzig-b88151e0e1553607cbebc197e1111ec4bf53a595.tar.gz
zig-b88151e0e1553607cbebc197e1111ec4bf53a595.zip
Merge pull request #12001 from ziglang/llvm14
Upgrade to LLVM 14
Diffstat (limited to 'src/zig_clang_cc1_main.cpp')
-rw-r--r--src/zig_clang_cc1_main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/zig_clang_cc1_main.cpp b/src/zig_clang_cc1_main.cpp
index 396d6ff529..f648adeba4 100644
--- a/src/zig_clang_cc1_main.cpp
+++ b/src/zig_clang_cc1_main.cpp
@@ -28,6 +28,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/LinkAllPasses.h"
+#include "llvm/MC/TargetRegistry.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
@@ -38,7 +39,6 @@
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
-#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/Timer.h"
@@ -57,7 +57,7 @@ using namespace llvm::opt;
// Main driver
//===----------------------------------------------------------------------===//
-static void LLVMErrorHandler(void *UserData, const std::string &Message,
+static void LLVMErrorHandler(void *UserData, const char *Message,
bool GenCrashDiag) {
DiagnosticsEngine &Diags = *static_cast<DiagnosticsEngine*>(UserData);
@@ -237,8 +237,10 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
static_cast<void*>(&Clang->getDiagnostics()));
DiagsBuffer->FlushDiagnostics(Clang->getDiagnostics());
- if (!Success)
+ if (!Success) {
+ Clang->getDiagnosticClient().finish();
return 1;
+ }
// Execute the frontend actions.
{