[MLIR][NFC] Value print update for block arguments

Emit some more information when printing/dumping `Value`s of
`BlockArgument` kind. This is purely to help for debugging purposes.

Differential Revision: https://reviews.llvm.org/D87670
This commit is contained in:
Uday Bondhugula 2020-09-15 10:58:45 +05:30
parent 757ac4ccfb
commit 9c40495a35
1 changed files with 6 additions and 4 deletions

View File

@ -2359,16 +2359,18 @@ void Value::print(raw_ostream &os) {
if (auto *op = getDefiningOp())
return op->print(os);
// TODO: Improve this.
assert(isa<BlockArgument>());
os << "<block argument>\n";
BlockArgument arg = this->cast<BlockArgument>();
os << "<block argument> of type '" << arg.getType()
<< "' at index: " << arg.getArgNumber() << '\n';
}
void Value::print(raw_ostream &os, AsmState &state) {
if (auto *op = getDefiningOp())
return op->print(os, state);
// TODO: Improve this.
assert(isa<BlockArgument>());
os << "<block argument>\n";
BlockArgument arg = this->cast<BlockArgument>();
os << "<block argument> of type '" << arg.getType()
<< "' at index: " << arg.getArgNumber() << '\n';
}
void Value::dump() {