mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 16:06:39 +08:00
[mlir] Emit errors if global constructors are found within lib/
Summary: This avoids adding any additional global constructors, like cl::opt. There is a temporary exception on IR/, which has a few cl::opts that require a bit of plumbing to remove. Differential Revision: https://reviews.llvm.org/D77824
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
# Enable errors for any global constructors.
|
||||
add_flag_if_supported("-Werror=global-constructors" WERROR_GLOBAL_CONSTRUCTOR)
|
||||
|
||||
add_subdirectory(Analysis)
|
||||
add_subdirectory(Conversion)
|
||||
add_subdirectory(Dialect)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# TODO: Remove the need for global constructors within IR/
|
||||
add_flag_if_supported("-Wno-global-constructors" WNO_GLOBAL_CONSTRUCTOR_MLIR_IR)
|
||||
|
||||
file(GLOB globbed *.c *.cpp)
|
||||
add_mlir_library(MLIRIR
|
||||
${globbed}
|
||||
|
||||
Reference in New Issue
Block a user