[Mesa-stable] [Mesa-dev] [PATCH v2] swr: push/pop DEBUG macro around llvm includes

Cherniak, Bruce bruce.cherniak at intel.com
Wed Jun 22 18:42:28 UTC 2016


Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>

> On Jun 17, 2016, at 11:01 AM, Tim Rowley <timothy.o.rowley at intel.com> wrote:
> 
> llvm redefines DEBUG; adding push/pop prevents a undefined reference
> to debug_refcnt_state in llvm-3.7+.
> 
> v2: add undef DEBUG
> ---
> src/gallium/drivers/swr/swr_shader.cpp | 10 +++++++---
> src/gallium/drivers/swr/swr_state.cpp  |  7 ++++++-
> 2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
> index 8af0700..4d1b604 100644
> --- a/src/gallium/drivers/swr/swr_shader.cpp
> +++ b/src/gallium/drivers/swr/swr_shader.cpp
> @@ -21,14 +21,18 @@
>  * IN THE SOFTWARE.
>  ***************************************************************************/
> 
> +// llvm redefines DEBUG
> +#pragma push_macro("DEBUG")
> +#undef DEBUG
> #include "JitManager.h"
> +#include "llvm-c/Core.h"
> +#include "llvm/Support/CBindingWrapping.h"
> +#pragma pop_macro("DEBUG")
> +
> #include "state.h"
> #include "state_llvm.h"
> #include "builder.h"
> 
> -#include "llvm-c/Core.h"
> -#include "llvm/Support/CBindingWrapping.h"
> -
> #include "tgsi/tgsi_strings.h"
> #include "gallivm/lp_bld_init.h"
> #include "gallivm/lp_bld_flow.h"
> diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
> index 3eeb98d..f4c3b0e 100644
> --- a/src/gallium/drivers/swr/swr_state.cpp
> +++ b/src/gallium/drivers/swr/swr_state.cpp
> @@ -21,9 +21,14 @@
>  * IN THE SOFTWARE.
>  ***************************************************************************/
> 
> +// llvm redefines DEBUG
> +#pragma push_macro("DEBUG")
> +#undef DEBUG
> +#include "JitManager.h"
> +#pragma pop_macro("DEBUG")
> +
> #include "common/os.h"
> #include "jit_api.h"
> -#include "JitManager.h"
> #include "state_llvm.h"
> 
> #include "gallivm/lp_bld_tgsi.h"
> -- 
> 1.9.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-stable mailing list