[CMake][NFC] Don't use uninitialized LLVM_REQUIRES_* (#175554)

LLVM_REQUIRES_* are per-target flags that are never set globally. Yet,
some files used these (undefined) flags for some logic. This patch
emoves these dead checks/unconditionally executes the logic. Note that
the referenced *.exports files are empty, so there is no need to make
related logic conditional on MSVC.
This commit is contained in:
Alexis Engelke 2026-01-12 17:13:20 +01:00 committed by GitHub
parent a698f7ebdf
commit 98640226ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 28 deletions

View File

@ -1,13 +1,5 @@
# If we don't need RTTI or EH, there's no reason to export anything
# from the plugin.
if(NOT MSVC) # MSVC mangles symbols differently, and
# PrintLLVMFunctionNames.export contains C++ symbols.
if(NOT LLVM_REQUIRES_RTTI)
if(NOT LLVM_REQUIRES_EH)
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LLVMPrintFunctionNames.exports)
endif()
endif()
endif()
# There's no reason to export anything from the plugin.
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LLVMPrintFunctionNames.exports)
add_llvm_library(LLVMPrintFunctionNames MODULE LLVMPrintFunctionNames.cpp PLUGIN_TOOL clang)

View File

@ -1,13 +1,5 @@
# If we don't need RTTI or EH, there's no reason to export anything
# from the plugin.
if( NOT MSVC ) # MSVC mangles symbols differently, and
# PrintFunctionNames.export contains C++ symbols.
if( NOT LLVM_REQUIRES_RTTI )
if( NOT LLVM_REQUIRES_EH )
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/PrintFunctionNames.exports)
endif()
endif()
endif()
# There's no reason to export anything from the plugin.
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/PrintFunctionNames.exports)
add_llvm_library(PrintFunctionNames MODULE PrintFunctionNames.cpp PLUGIN_TOOL clang)

View File

@ -2,13 +2,8 @@ if( NOT LLVM_BUILD_TOOLS )
set(EXCLUDE_FROM_ALL ON)
endif()
# If we don't need RTTI or EH, there's no reason to export anything
# from this plugin.
if( NOT LLVM_REQUIRES_RTTI )
if( NOT LLVM_REQUIRES_EH )
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/bugpoint.exports)
endif()
endif()
# There's no reason to export anything from the plugin.
set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/bugpoint.exports)
if(WIN32 OR CYGWIN OR ZOS)
set(LLVM_LINK_COMPONENTS Core Support)

View File

@ -3,7 +3,7 @@ add_library(MathTest STATIC
target_include_directories(MathTest PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include")
if(NOT LLVM_REQUIRES_RTTI)
if(NOT LLVM_ENABLE_RTTI)
target_compile_options(MathTest PUBLIC -fno-rtti)
endif()