summaryrefslogtreecommitdiff
path: root/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2016-05-16 14:28:02 +0000
committerRenato Golin <renato.golin@linaro.org>2016-05-16 14:28:02 +0000
commit3b0d377ef8e3c801965565160a9b9db0d0687600 (patch)
tree6e6501c501aa8a62b14c7cec8735a144229b1ca5 /lib/IR/LLVMContext.cpp
parent5c1f23686d84c0bfc1d3a30d4a6c66bc078d526d (diff)
[llc] New diagnostic handler
Without a diagnostic handler installed, llc's behaviour is to exit on the first error that it encounters. This is very different from the behaviour of clang and other front ends, which try to gather as many errors as possible before exiting. This commit adds a diagnostic handler to llc, allowing it to find and report more than one error. The old behaviour is preserved under a flag (-exit-on-error). Some of the tests fail with the new diagnostic handler, so they have to use the new flag in order to run under the previous behaviour. Some of these are known bugs, others need further investigation. Ideally, we should fix the tests and remove the flag at some point in the future. Reapplied after fixing the LLDB build that was broken due to the new DiagnosticSeverity in LLVMContext.h, and fixed an UB in the new change. Patch by Diana Picus. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/LLVMContext.cpp')
-rw-r--r--lib/IR/LLVMContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/IR/LLVMContext.cpp b/lib/IR/LLVMContext.cpp
index 9369cbd6a08..9f8680cf6c0 100644
--- a/lib/IR/LLVMContext.cpp
+++ b/lib/IR/LLVMContext.cpp
@@ -231,7 +231,8 @@ static bool isDiagnosticEnabled(const DiagnosticInfo &DI) {
return true;
}
-static const char *getDiagnosticMessagePrefix(DiagnosticSeverity Severity) {
+const char *
+LLVMContext::getDiagnosticMessagePrefix(DiagnosticSeverity Severity) {
switch (Severity) {
case DS_Error:
return "error";