From 071ae19af04e1ab6b1e535544a9bf829b9cf1af9 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 31 May 2026 19:07:34 -0400 Subject: [PATCH] xo-jit: workaround llvm warnings on gcc 14.3 --- example/ex1/ex1.cpp | 3 +++ example/ex2_jit/ex2_jit.cpp | 3 +++ include/xo/jit/IrPipeline.hpp | 3 +++ src/jit/CMakeLists.txt | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/example/ex1/ex1.cpp b/example/ex1/ex1.cpp index 761c79fc..017f19ec 100644 --- a/example/ex1/ex1.cpp +++ b/example/ex1/ex1.cpp @@ -26,7 +26,10 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Transforms/InstCombine/InstCombine.h" #include "llvm/Transforms/Scalar.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include "llvm/Transforms/Scalar/GVN.h" +#pragma GCC diagnostic pop #include "llvm/Transforms/Scalar/Reassociate.h" #include "llvm/Transforms/Scalar/SimplifyCFG.h" #include diff --git a/example/ex2_jit/ex2_jit.cpp b/example/ex2_jit/ex2_jit.cpp index 08a0bc16..0e8e68d3 100644 --- a/example/ex2_jit/ex2_jit.cpp +++ b/example/ex2_jit/ex2_jit.cpp @@ -27,7 +27,10 @@ #include "llvm/Target/TargetMachine.h" #include "llvm/Transforms/InstCombine/InstCombine.h" #include "llvm/Transforms/Scalar.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include "llvm/Transforms/Scalar/GVN.h" +#pragma GCC diagnostic pop #include "llvm/Transforms/Scalar/Reassociate.h" #include "llvm/Transforms/Scalar/SimplifyCFG.h" diff --git a/include/xo/jit/IrPipeline.hpp b/include/xo/jit/IrPipeline.hpp index 5268d088..2658b472 100644 --- a/include/xo/jit/IrPipeline.hpp +++ b/include/xo/jit/IrPipeline.hpp @@ -29,7 +29,10 @@ # include "llvm/Target/TargetMachine.h" # include "llvm/Transforms/InstCombine/InstCombine.h" # include "llvm/Transforms/Scalar.h" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" # include "llvm/Transforms/Scalar/GVN.h" +# pragma GCC diagnostic pop # include "llvm/Transforms/Utils/Mem2Reg.h" # include "llvm/Transforms/Scalar/Reassociate.h" # include "llvm/Transforms/Scalar/SimplifyCFG.h" diff --git a/src/jit/CMakeLists.txt b/src/jit/CMakeLists.txt index ce09091b..77bd9a5e 100644 --- a/src/jit/CMakeLists.txt +++ b/src/jit/CMakeLists.txt @@ -43,7 +43,8 @@ execute_process( message(STATUS "LLVM_LIBS=[${LLVM_LIBS}]") -target_include_directories(${SELF_LIB} PUBLIC ${LLVM_INCLUDE_DIRS}) +# SYSTEM: suppress warnings from LLVM headers (e.g. gcc14 false positive in SmallDenseMap) +target_include_directories(${SELF_LIB} SYSTEM PUBLIC ${LLVM_INCLUDE_DIRS}) target_compile_definitions(${SELF_LIB} PUBLIC ${LLVM_DEFINITIONS_LIST}) target_link_directories(${SELF_LIB} PUBLIC ${LLVM_LIBRARY_DIR}) target_link_libraries(${SELF_LIB} PUBLIC ${LLVM_LIBS})