OSDN Git Service

[llc] New diagnostic handler
authorRenato Golin <renato.golin@linaro.org>
Mon, 16 May 2016 14:28:02 +0000 (14:28 +0000)
committerRenato Golin <renato.golin@linaro.org>
Mon, 16 May 2016 14:28:02 +0000 (14:28 +0000)
commit3b0d377ef8e3c801965565160a9b9db0d0687600
tree6e6501c501aa8a62b14c7cec8735a144229b1ca5
parent5c1f23686d84c0bfc1d3a30d4a6c66bc078d526d
[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
31 files changed:
include/llvm/IR/DiagnosticInfo.h
include/llvm/IR/LLVMContext.h
lib/IR/LLVMContext.cpp
test/CodeGen/AArch64/arm64-inline-asm-error-I.ll
test/CodeGen/AArch64/arm64-inline-asm-error-J.ll
test/CodeGen/AArch64/arm64-inline-asm-error-K.ll
test/CodeGen/AArch64/arm64-inline-asm-error-L.ll
test/CodeGen/AArch64/arm64-inline-asm-error-M.ll
test/CodeGen/AArch64/arm64-inline-asm-error-N.ll
test/CodeGen/AMDGPU/call.ll
test/CodeGen/AMDGPU/dynamic_stackalloc.ll
test/CodeGen/AMDGPU/no-hsa-graphics-shaders.ll
test/CodeGen/AMDGPU/private-memory-broken.ll
test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll
test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll
test/CodeGen/BPF/many_args1.ll
test/CodeGen/BPF/many_args2.ll
test/CodeGen/BPF/struct_ret1.ll
test/CodeGen/BPF/struct_ret2.ll
test/CodeGen/MIR/Generic/invalid-jump-table-kind.mir
test/CodeGen/MIR/Generic/llvm-ir-error-reported.mir
test/CodeGen/MIR/Generic/machine-function-missing-function.mir
test/CodeGen/MIR/Generic/machine-function-missing-name.mir
test/CodeGen/MIR/Generic/machine-function-redefinition-error.mir
test/CodeGen/MIR/X86/spill-slot-fixed-stack-object-aliased.mir
test/CodeGen/MIR/X86/spill-slot-fixed-stack-object-immutable.mir
test/CodeGen/MIR/X86/variable-sized-stack-object-size-error.mir
test/CodeGen/PowerPC/crbit-asm-disabled.ll
test/CodeGen/PowerPC/vec-asm-disabled.ll
test/CodeGen/X86/asm-reject-reg-type-mismatch.ll
tools/llc/llc.cpp