glsl: replace some C++ code with C
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 15 Jul 2021 12:28:00 +0000 (22:28 +1000)
committerMarge Bot <eric+marge@anholt.net>
Sat, 17 Jul 2021 10:07:37 +0000 (10:07 +0000)
commit749251391d967ce5450a6adfeb64cb773cce2508
tree199ed144c5622b33730757409850c8b66b3987fa
parented57666a5c10a601b89868fa986d9ef215b908ed
glsl: replace some C++ code with C

This replaces some new/delete uses with malloc/free.

This is more consistent with most of the other glsl IR code but
more importantly it allows the game "Battle Block Theater" to
start working on some mesa drivers. The game overrides new and
ends up throwing an assert and crashing when it sees this
function calling new [0].

Note: The game still crashes with radeonsi due to similar conflicts
with LLVM.

CC: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11907>
src/compiler/glsl/linker.cpp