clover: Use Clang's diagnostics
authorVedran Miletić <vedran@miletic.net>
Wed, 21 Dec 2016 12:49:36 +0000 (13:49 +0100)
committerFrancisco Jerez <currojerez@riseup.net>
Sun, 25 Dec 2016 02:35:09 +0000 (18:35 -0800)
commitd9fef848a651b47520cbeb72c38b93d4fbf842a8
tree28e2664884401f4dbdebb6b5c7f62095bcc8253f
parent3a30b1a556b1ed7dc60befcec16343e80a3bd77e
clover: Use Clang's diagnostics

Presently errors from frontend are handled only if they occur in
clang::CompilerInvocation::CreateFromArgs(). This patch uses
clang::DiagnosticsEngine to detect errors such as invalid values for
Clang frontend arguments.

Fixes Piglit's cl/program/build/fail/invalid-version-declaration.cl
test.

v2: fix inconsistent code formatting

Signed-off-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: Aaron Watry <awatry@gmail.com>
src/gallium/state_trackers/clover/llvm/invocation.cpp