Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlir/include/mlir/IR/Operation.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class alignas(8) Operation final

void print(raw_ostream &os, const OpPrintingFlags &flags = std::nullopt);
void print(raw_ostream &os, AsmState &state);
void dump();
void dump(bool assumeVerified = false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to ensure dump is available, we should mark it with LLVM_DUMP_METHOD. Helps prevent the symbol from being killed off.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, please use LLVM_DUMP_METHOD


//===--------------------------------------------------------------------===//
// Operands
Expand Down
7 changes: 5 additions & 2 deletions mlir/lib/IR/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3980,8 +3980,11 @@ void Operation::print(raw_ostream &os, AsmState &state) {
}
}

void Operation::dump() {
print(llvm::errs(), OpPrintingFlags().useLocalScope());
void Operation::dump(bool assumeVerified) {
OpPrintingFlags flags;
if (assumeVerified)
flags.assumeVerified();
print(llvm::errs(), flags.useLocalScope());
llvm::errs() << "\n";
}

Expand Down
Loading