9 #ifndef MLIR_TRACING_EXECUTIONCONTEXT_H
10 #define MLIR_TRACING_EXECUTIONCONTEXT_H
14 #include "llvm/ADT/SmallVector.h"
27 : parent(parent), action(action), depth(depth) {}
31 void print(raw_ostream &os,
bool withContext)
const;
33 print(llvm::errs(),
true);
81 onBreakpointControlExecutionCallback = callback;
115 breakpoints.push_back(manager);
125 CallbackTy onBreakpointControlExecutionCallback;
130 std::optional<int> depthToBreak;
An action is a specific action that is to be taken by the compiler, that can be toggled and controlle...
A breakpoint manager is responsible for managing a set of breakpoints and matching them to a given ac...
This abstract class represents a breakpoint.
The ExecutionContext is the main orchestration of the infrastructure, it acts as a handler in the MLI...
void registerObserver(Observer *observer)
Register a new Observer on this context.
function_ref< Control(const ActionActiveStack *)> CallbackTy
The type of the callback that is used to control the execution.
Control
Enum that allows the client of the context to control the execution of the action.
ExecutionContext()=default
ExecutionContext(CallbackTy callback)
Create an ExecutionContext with a callback that is used to control the execution.
void addBreakpointManager(BreakpointManager *manager)
Register a new BreakpointManager on this context.
void setCallback(CallbackTy callback)
Set the callback that is used to control the execution.
void operator()(function_ref< void()> transform, const Action &action)
Process the given action.
Include the generated interface declarations.
This class is used to keep track of the active actions in the stack.
const ActionActiveStack * getParent() const
void setBreakpoint(Breakpoint *breakpoint)
const Action & getAction() const
void print(raw_ostream &os, bool withContext) const
Breakpoint * getBreakpoint() const
ActionActiveStack(const ActionActiveStack *parent, const Action &action, int depth)
This abstract class defines the interface used to observe an Action execution.
virtual void afterExecute(const ActionActiveStack *action)
This method is called after the Action is executed, if it was executed.
virtual ~Observer()=default
virtual void beforeExecute(const ActionActiveStack *action, Breakpoint *breakpoint, bool willExecute)
This method is called before the Action is executed If a breakpoint was hit, it is passed as an argum...