Remove dependency from lib/CAPI/IR/IR.cpp on registerAllDialects() (build fix)
authorMehdi Amini <joker.eph@gmail.com>
Fri, 14 Aug 2020 16:34:24 +0000 (16:34 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Fri, 14 Aug 2020 16:35:22 +0000 (16:35 +0000)
This library does not depend on all the dialects, conceptually. This is
changing the recently introduced `mlirContextLoadAllDialects()` function
to not call `registerAllDialects()` itself, which aligns it better with
the C++ code anyway (and this is deprecated and will be removed soon).

mlir/lib/CAPI/IR/IR.cpp

index 2417c1d..96e2266 100644 (file)
@@ -13,7 +13,6 @@
 #include "mlir/IR/Module.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/IR/Types.h"
-#include "mlir/InitAllDialects.h"
 #include "mlir/Parser.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -98,8 +97,7 @@ MlirContext mlirContextCreate() {
 void mlirContextDestroy(MlirContext context) { delete unwrap(context); }
 
 void mlirContextLoadAllDialects(MlirContext context) {
-  registerAllDialects(unwrap(context));
-  getGlobalDialectRegistry().loadAll(unwrap(context));
+  unwrap(context).loadAllGloballyRegisteredDialects();
 }
 
 /* ========================================================================== */