11 #include "mlir/Support/IndentedOstream.h"
14 using namespace circt;
16 static void dump(
DIModule &module, raw_indented_ostream &os);
19 os <<
"Variable " << variable.
name;
21 os <<
" at " << variable.
loc;
25 if (
auto blockArg = dyn_cast_or_null<BlockArgument>(variable.
value)) {
26 os <<
"Arg " << blockArg.getArgNumber() <<
" of "
27 << blockArg.getOwner()->getParentOp()->getName();
28 }
else if (
auto result = dyn_cast_or_null<OpResult>(variable.
value)) {
29 os <<
"Result " << result.getResultNumber() <<
" of "
30 << result.getDefiningOp()->getName();
32 os <<
" of type " << variable.
value.getType() <<
" at "
33 << variable.
value.getLoc() <<
"\n";
39 os <<
"Instance " << instance.
name <<
" of " << instance.
module->
name;
41 os <<
" for " << instance.
op->getName() <<
" at " << instance.
op->getLoc();
51 os <<
"Module " << module.
name;
53 os <<
" for " << module.
op->getName() <<
" at " << module.
op->getLoc();
64 os <<
"DebugInfo for " << di.
operation->getName() <<
" at "
68 dump(*nameAndModule.second, os);
74 raw_indented_ostream indentedOs(os);
static void dump(DIModule &module, raw_indented_ostream &os)
LogicalResult dumpDebugInfo(Operation *module, llvm::raw_ostream &os)
Dump the debug information in the given module in a human-readable format.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Operation * op
The operation that generated this instance.
StringAttr name
The name of this instance.
DIModule * module
The instantiated module.
bool isInline
If this is an inline scope created by a dbg.scope operation.
Operation * op
The operation that generated this level of hierarchy.
SmallVector< DIInstance *, 0 > instances
Levels of hierarchy nested under this module.
SmallVector< DIVariable *, 0 > variables
Variables declared within this module.
StringAttr name
The name of this level of hierarchy.
Value value
The SSA value representing the value of this variable.
StringAttr name
The name of this variable.
LocationAttr loc
The location of the variable's declaration.
Debug information attached to an operation and the operations nested within.
Operation * operation
The operation that was passed to the constructor.
llvm::MapVector< StringAttr, DIModule * > moduleNodes
A mapping from module name to module debug info.