diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt index 6cd3449727470..e6512a888284c 100644 --- a/interpreter/CMakeLists.txt +++ b/interpreter/CMakeLists.txt @@ -209,6 +209,11 @@ if(builtin_llvm) set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "") + # Always build LLVM with C++17. It is not necessary to compile with the same + # C++ standard as the rest of ROOT and sometimes it doesn't even work. + set(_cxx_standard ${CMAKE_CXX_STANDARD}) + set(CMAKE_CXX_STANDARD 17) + #---Reduce log level to suppress STATUS messages from LLVM if(NOT DEFINED CMAKE_MESSAGE_LOG_LEVEL) set(CMAKE_MESSAGE_LOG_LEVEL "NOTICE") @@ -226,6 +231,8 @@ if(builtin_llvm) unset(CMAKE_MESSAGE_LOG_LEVEL) endif() + set(CMAKE_CXX_STANDARD ${_cxx_standard}) + set(LLVM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/llvm-project/llvm/include ${CMAKE_CURRENT_BINARY_DIR}/llvm-project/llvm/include CACHE STRING "LLVM include directories." @@ -372,7 +379,14 @@ else() # Disable linking against shared LLVM set(LLVM_LINK_LLVM_DYLIB OFF) + # Always build LLVM with C++17. It is not necessary to compile with the same + # C++ standard as the rest of ROOT and sometimes it doesn't even work. + set(_cxx_standard ${CMAKE_CXX_STANDARD}) + set(CMAKE_CXX_STANDARD 17) + add_subdirectory(llvm-project/clang EXCLUDE_FROM_ALL) + + set(CMAKE_CXX_STANDARD ${_cxx_standard}) endif(builtin_clang) set( CLANG_BUILT_STANDALONE 1 ) diff --git a/interpreter/llvm-project/llvm-project.tag b/interpreter/llvm-project/llvm-project.tag index eba6c9f06e1a6..13158746c5fa1 100644 --- a/interpreter/llvm-project/llvm-project.tag +++ b/interpreter/llvm-project/llvm-project.tag @@ -1 +1 @@ -ROOT-llvm18-20250225-01 +ROOT-llvm18-20250313-01 diff --git a/interpreter/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h b/interpreter/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h index aaaed3f5ceac6..2f6fff6f76e94 100644 --- a/interpreter/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h +++ b/interpreter/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h @@ -539,7 +539,13 @@ ScopedPrinter::printHex(StringRef Label, startLine() << Label << ": " << hex(Value) << "\n"; } -struct DelimitedScope; +struct DelimitedScope { + DelimitedScope(ScopedPrinter &W) : W(&W) {} + DelimitedScope() : W(nullptr) {} + virtual ~DelimitedScope() = default; + virtual void setPrinter(ScopedPrinter &W) = 0; + ScopedPrinter *W; +}; class JSONScopedPrinter : public ScopedPrinter { private: @@ -838,14 +844,6 @@ class JSONScopedPrinter : public ScopedPrinter { } }; -struct DelimitedScope { - DelimitedScope(ScopedPrinter &W) : W(&W) {} - DelimitedScope() : W(nullptr) {} - virtual ~DelimitedScope() = default; - virtual void setPrinter(ScopedPrinter &W) = 0; - ScopedPrinter *W; -}; - struct DictScope : DelimitedScope { explicit DictScope() = default; explicit DictScope(ScopedPrinter &W) : DelimitedScope(W) { W.objectBegin(); }