Add a utility method to MLIRContext get a registered dialect with the derived...
authorRiver Riddle <riverriddle@google.com>
Mon, 13 May 2019 19:42:25 +0000 (12:42 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 20 May 2019 20:40:13 +0000 (13:40 -0700)
commitbc5c7378b292faae5cd0f1926c4a5c1fb9be522a
treed50fb03e07b7db83412872dfc2ebadfaca995634
parentd39a30626edf0b4367c067b9e36298238826cf19
Add a utility method to MLIRContext get a registered dialect with the derived type instead of the string name. The derived dialect type must provide a static 'getDialectNamespace' method.

    This means that we can now do something like:
      ctx->getRegisteredDialect<LLVMDialect>();

    as opposed to:
      static_cast<LLVMDialect *>(ctx->getRegisteredDialect("llvm");

--

PiperOrigin-RevId: 247989896
mlir/examples/Linalg/Linalg1/lib/ConvertToLLVMDialect.cpp
mlir/examples/toy/Ch5/mlir/LateLowering.cpp
mlir/include/mlir/IR/MLIRContext.h
mlir/include/mlir/LLVMIR/LLVMDialect.h
mlir/lib/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/LLVMIR/Transforms/ConvertToLLVMDialect.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp