OSDN Git Service

Refactor backend diagnostics for unsupported features
authorOliver Stannard <oliver.stannard@arm.com>
Wed, 27 Jan 2016 17:30:33 +0000 (17:30 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Wed, 27 Jan 2016 17:30:33 +0000 (17:30 +0000)
commitbf8415a84da51dc94f8d9a7000cd372f7c88f76b
tree792548213de2641ab2e32073b3b9dc02cdf0ffb0
parent377bac24c260e30490e6f1cfede783f6916011ff
Refactor backend diagnostics for unsupported features

The BPF and WebAssembly backends had identical code for emitting errors
for unsupported features, and AMDGPU had very similar code. This merges
them all into one DiagnosticInfo subclass, that can be used by any
backend.

There should be minimal functional changes here, but some AMDGPU tests
have been updated for the new format of errors (it used a slightly
different format to BPF and WebAssembly). The AMDGPU error messages will
now benefit from having precise source locations when debug info is
available.

The implementation of DiagnosticInfoUnsupported::print must be in
lib/Codegen rather than in the existing file in lib/IR/ to avoid
introducing a dependency from IR to CodeGen.

Differential Revision: http://reviews.llvm.org/D16590

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258951 91177308-0d34-0410-b5e6-96231b3b80d8
21 files changed:
include/llvm/IR/DiagnosticInfo.h
lib/CodeGen/CMakeLists.txt
lib/CodeGen/DiagnosticInfoCodeGen.cpp [new file with mode: 0644]
lib/IR/DiagnosticInfo.cpp
lib/Target/AMDGPU/AMDGPUDiagnosticInfoUnsupported.cpp [deleted file]
lib/Target/AMDGPU/AMDGPUDiagnosticInfoUnsupported.h [deleted file]
lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
lib/Target/AMDGPU/CMakeLists.txt
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/BPF/BPFISelLowering.cpp
lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
test/CodeGen/AMDGPU/addrspacecast.ll
test/CodeGen/AMDGPU/call.ll
test/CodeGen/AMDGPU/dynamic_stackalloc.ll
test/CodeGen/AMDGPU/global-zero-initializer.ll
test/CodeGen/AMDGPU/lds-initializer.ll
test/CodeGen/AMDGPU/lds-zero-initializer.ll
test/CodeGen/AMDGPU/llvm.amdgcn.dispatch.ptr.ll
test/CodeGen/AMDGPU/no-hsa-graphics-shaders.ll
test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll