Refactor backend diagnostics for unsupported features

Description

Refactor backend diagnostics for unsupported features

Re-commit of r258951 after fixing layering violation.

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.

Details

Committed
olista01Feb 2 2016, 5:52 AM
Parents
rL259497: Fix for PR8901: attribute "mode" rejected for enums and dependent types.
Branches
Unknown
Tags
Unknown

Tweaked in r259612.

We should not use neither Twine nor Twine& in DiagnosticInfo.
Twine is not designed for the purpose.

I think StringRef (not StringRef&) might be suitable there. Or use llvm::SmallString, or use std::string.

/llvm/trunk/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
612

It has an implicit constructor and temporary local object, Twine("unsupported call..."). Don't capture it in the record as Twine&.