[Mlir-commits] [mlir] 33f4315 - [AsmParser] move AsmParser::getContext to IR library.

Chris Lattner llvmlistbot at llvm.org
Wed Sep 29 22:07:06 PDT 2021


Author: Chris Lattner
Date: 2021-09-29T22:07:00-07:00
New Revision: 33f43153248a286f7749d2a838259fb3431ca929

URL: https://github.com/llvm/llvm-project/commit/33f43153248a286f7749d2a838259fb3431ca929
DIFF: https://github.com/llvm/llvm-project/commit/33f43153248a286f7749d2a838259fb3431ca929.diff

LOG: [AsmParser] move AsmParser::getContext to IR library.

This is (perhaps unintuitively) where the other AsmParser method
implementations are, which means that dialects don't generally need
to depend on MLIRParser directly.  This should fix a build failure
building .so files on the mlir-nvidia builder.

Added: 
    

Modified: 
    mlir/lib/IR/AsmPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/AsmPrinter.cpp b/mlir/lib/IR/AsmPrinter.cpp
index b6438fb7071b..3d9090daaf8b 100644
--- a/mlir/lib/IR/AsmPrinter.cpp
+++ b/mlir/lib/IR/AsmPrinter.cpp
@@ -15,6 +15,7 @@
 #include "mlir/IR/AffineMap.h"
 #include "mlir/IR/AsmState.h"
 #include "mlir/IR/Attributes.h"
+#include "mlir/IR/Builders.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/Dialect.h"
 #include "mlir/IR/DialectImplementation.h"
@@ -60,15 +61,17 @@ AsmParser::~AsmParser() {}
 DialectAsmParser::~DialectAsmParser() {}
 OpAsmParser::~OpAsmParser() {}
 
-//===--------------------------------------------------------------------===//
+MLIRContext *AsmParser::getContext() const { return getBuilder().getContext(); }
+
+//===----------------------------------------------------------------------===//
 // DialectAsmPrinter
-//===--------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 
 DialectAsmPrinter::~DialectAsmPrinter() {}
 
-//===--------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 // OpAsmPrinter
-//===--------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 
 OpAsmPrinter::~OpAsmPrinter() {}
 
@@ -100,9 +103,9 @@ void OpAsmPrinter::printFunctionalType(Operation *op) {
     os << ')';
 }
 
-//===--------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 // Operation OpAsm interface.
-//===--------------------------------------------------------------------===//
+//===----------------------------------------------------------------------===//
 
 /// The OpAsmOpInterface, see OpAsmInterface.td for more details.
 #include "mlir/IR/OpAsmInterface.cpp.inc"


        


More information about the Mlir-commits mailing list