67 auto handleUserInput = [&]() ->
bool {
68 if (!onBreakpointControlExecutionCallback)
70 auto todoNext = onBreakpointControlExecutionCallback(
actionStack);
73 depthToBreak = std::nullopt;
76 depthToBreak = std::nullopt;
79 depthToBreak = depth + 1;
85 depthToBreak = depth - 1;
88 depthToBreak = std::nullopt;
89 rerunControlStack.push_back(depth);
92 llvm::report_fatal_error(
"Unknown control request");
95 auto rerunCurrentActionIfRequested = [&]() ->
bool {
96 if (!rerunControlStack.empty() && rerunControlStack.back() == depth) {
98 rerunControlStack.pop_back();
108 for (
auto *breakpointManager : breakpoints) {
109 breakpoint = breakpointManager->match(action);
115 bool shouldExecuteAction =
true;
118 if (breakpoint || (depthToBreak && depth <= depthToBreak))
119 shouldExecuteAction = handleUserInput();
122 for (
auto *observer : observers)
123 observer->beforeExecute(
actionStack, breakpoint, shouldExecuteAction);
125 if (shouldExecuteAction) {
130 for (
auto *observer : observers)
134 if (rerunCurrentActionIfRequested())
137 if (depthToBreak && depth <= depthToBreak) {
139 rerunCurrentActionIfRequested();
static const LLVM_THREAD_LOCAL ActionActiveStack * actionStack
void registerObserver(Observer *observer)
Register a new Observer on this context.
void operator()(function_ref< void()> transform, const Action &action)
Process the given action.
This abstract class defines the interface used to observe an Action execution.