13 #include "llvm/Support/raw_ostream.h"
22 os <<
"<Operation:nullptr>";
31 os <<
"<Region:nullptr>";
42 int blockId = std::distance(entry->getIterator(), block->getIterator());
43 os <<
"Block #" << blockId <<
" for ";
46 if (!shouldSkipRegions)
51 if (
auto *op = llvm::dyn_cast_if_present<Operation *>(*
this))
53 if (
auto *region = llvm::dyn_cast_if_present<Region *>(*
this))
55 if (
auto *block = llvm::dyn_cast_if_present<Block *>(*
this))
57 llvm_unreachable(
"unknown IRUnit");
static void printOp(llvm::raw_ostream &os, Operation *op, OpPrintingFlags &flags)
static void printRegion(llvm::raw_ostream &os, Region *region, OpPrintingFlags &flags)
static void printBlock(llvm::raw_ostream &os, Block *block, OpPrintingFlags &flags)
Block represents an ordered list of Operations.
Region * getParent() const
Provide a 'getParent' method for ilist_node_with_parent methods.
void print(raw_ostream &os)
IRUnit is a union of the different types of IR objects that consistute the IR structure (other than T...
void print(raw_ostream &os, OpPrintingFlags flags=OpPrintingFlags().skipRegions().useLocalScope()) const
Print the IRUnit to the given stream.
Set of flags used to control the behavior of the various IR print methods (e.g.
bool shouldSkipRegions() const
Return if regions should be skipped.
OpPrintingFlags & skipRegions(bool skip=true)
Skip printing regions.
Operation is the basic unit of execution within MLIR.
void print(raw_ostream &os, const OpPrintingFlags &flags=std::nullopt)
This class contains a list of basic blocks and a link to the parent operation it is attached to.
unsigned getRegionNumber()
Return the number of this region in the parent operation.
Operation * getParentOp()
Return the parent operation this region is attached to.
Include the generated interface declarations.
raw_ostream & operator<<(raw_ostream &os, const AliasResult &result)