[PATCH] D77824: [mlir] Emit errors if global constructors are found within lib/

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 13:27:22 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG3db57d14ecf5: [mlir] Emit errors if global constructors are found within lib/ (authored by rriddle).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77824/new/

https://reviews.llvm.org/D77824

Files:
  mlir/lib/CMakeLists.txt
  mlir/lib/IR/CMakeLists.txt


Index: mlir/lib/IR/CMakeLists.txt
===================================================================
--- mlir/lib/IR/CMakeLists.txt
+++ mlir/lib/IR/CMakeLists.txt
@@ -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}
Index: mlir/lib/CMakeLists.txt
===================================================================
--- mlir/lib/CMakeLists.txt
+++ mlir/lib/CMakeLists.txt
@@ -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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77824.256644.patch
Type: text/x-patch
Size: 777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200410/ffcf0ee9/attachment.bin>


More information about the llvm-commits mailing list