clc: Rework logging a bit
authorJason Ekstrand <jason.ekstrand@collabora.com>
Wed, 13 Apr 2022 21:16:30 +0000 (16:16 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 14 Apr 2022 21:19:56 +0000 (21:19 +0000)
commit6099e6ce9ac499719f4360d34a4c8841d01c02e7
tree144284cbb26fae7974bcd2421980f9a6ead0e721
parent6e3b9b1b1d8f5b88ac5f0a660c9c08261490206e
clc: Rework logging a bit

First, separate out the LLVM context logging to make it take a
clc_logger instead of passing in a string stream.  Currently, the LLVM
context may outlive the string stream which we assign which may lead to
use-after-free errors.  Second, use a separate string stream for clang
diagnosticl logging which we intentionally declare before the compiler
so the compiler can't outlive it.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15937>
src/compiler/clc/clc_helpers.cpp