Skip to content

Commit

Permalink
[AsmParser] move AsmParser::getContext to IR library.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lattner committed Sep 30, 2021
1 parent 3310e00 commit 33f4315
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions mlir/lib/IR/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -60,15 +61,17 @@ AsmParser::~AsmParser() {}
DialectAsmParser::~DialectAsmParser() {}
OpAsmParser::~OpAsmParser() {}

//===--------------------------------------------------------------------===//
MLIRContext *AsmParser::getContext() const { return getBuilder().getContext(); }

//===----------------------------------------------------------------------===//
// DialectAsmPrinter
//===--------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

DialectAsmPrinter::~DialectAsmPrinter() {}

//===--------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
// OpAsmPrinter
//===--------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

OpAsmPrinter::~OpAsmPrinter() {}

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 33f4315

Please sign in to comment.