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

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 11 11:43:36 PDT 2020


bondhugula added inline comments.


================
Comment at: mlir/lib/IR/CMakeLists.txt:2
+# TODO: Remove the need for global constructors within IR/
+add_flag_if_supported("-Wno-global-constructors" WNO_GLOBAL_CONSTRUCTOR_MLIR_IR)
+
----------------
mehdi_amini wrote:
> bondhugula wrote:
> > This should be added to test/lib/ as well?
> We could, but we don't really have a reason to limit what happens in tests do we?
> 
> The motivation for doing this right now is about preserving the ability to build and embed the compiler in a product without having these ctors.
tests/lib is part of mlir-opt. Doesn't static init affect the latter's load time?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77824





More information about the llvm-commits mailing list