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).
This commit is contained in:
Mehdi Amini
2020-08-14 16:34:24 +00:00
parent 63aed9cbe5
commit 059cb8b3c9

View 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();
}
/* ========================================================================== */