9 #ifndef MLIR_DEBUG_BREAKPOINTMANAGERS_TAGBREAKPOINTMANAGER_H
10 #define MLIR_DEBUG_BREAKPOINTMANAGERS_TAGBREAKPOINTMANAGER_H
15 #include "llvm/ADT/MapVector.h"
25 void print(raw_ostream &os)
const override { os <<
"Tag: `" << tag <<
'`'; }
41 auto it = breakpoints.find(action.
getTag());
42 if (it != breakpoints.end() && it->second->isEnabled())
43 return it->second.get();
51 auto result = breakpoints.insert({tag,
nullptr});
52 auto &it = result.first;
54 it->second = std::make_unique<TagBreakpoint>(tag.str());
55 return it->second.get();
59 llvm::StringMap<std::unique_ptr<TagBreakpoint>> breakpoints;
An action is a specific action that is to be taken by the compiler, that can be toggled and controlle...
virtual StringRef getTag() const =0
Return a string "tag" which intends to uniquely identify this type of action.
This class provides a CRTP wrapper around a base breakpoint class to define a few necessary utility m...
CRTP base class for BreakpointManager implementations.
This abstract class represents a breakpoint.
This is a manager to store a collection of breakpoints that trigger on tags.
TagBreakpoint * addBreakpoint(StringRef tag)
Add a breakpoint to the manager for the given tag and return it.
Breakpoint * match(const Action &action) const override
Try to match a Breakpoint to a given Action.
Simple breakpoint matching an action "tag".
void print(raw_ostream &os) const override
TagBreakpoint(StringRef tag)
Include the generated interface declarations.