[Mlir-commits] [mlir] 059cb8b - Remove dependency from lib/CAPI/IR/IR.cpp on registerAllDialects() (build fix)

Mehdi Amini llvmlistbot at llvm.org
Fri Aug 14 09:36:24 PDT 2020


Author: Mehdi Amini
Date: 2020-08-14T16:35:22Z
New Revision: 059cb8b3c9f004b0720e2b1168f2f9c9273ff0f7

URL: https://github.com/llvm/llvm-project/commit/059cb8b3c9f004b0720e2b1168f2f9c9273ff0f7
DIFF: https://github.com/llvm/llvm-project/commit/059cb8b3c9f004b0720e2b1168f2f9c9273ff0f7.diff

LOG: Remove dependency from lib/CAPI/IR/IR.cpp on registerAllDialects() (build fix)

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).

Added: 
    

Modified: 
    mlir/lib/CAPI/IR/IR.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/CAPI/IR/IR.cpp b/mlir/lib/CAPI/IR/IR.cpp
index 2417c1d6d7e4..96e226634390 100644
--- a/mlir/lib/CAPI/IR/IR.cpp
+++ b/mlir/lib/CAPI/IR/IR.cpp
@@ -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();
 }
 
 /* ========================================================================== */


        


More information about the Mlir-commits mailing list