9 #ifndef MLIR_TRACING_DEBUGCOUNTER_H
10 #define MLIR_TRACING_DEBUGCOUNTER_H
13 #include "llvm/ADT/StringMap.h"
38 void addCounter(StringRef actionTag, int64_t countToSkip,
39 int64_t countToStopAfter);
46 void print(raw_ostream &os)
const;
55 bool shouldExecute(StringRef tag);
58 void applyCLOptions();
62 Counter(int64_t countToSkip = 0, int64_t countToStopAfter = -1)
63 : countToSkip(countToSkip), countToStopAfter(countToStopAfter) {}
70 int64_t countToStopAfter;
74 llvm::StringMap<Counter> counters;
An action is a specific action that is to be taken by the compiler, that can be toggled and controlle...
This class implements an action handler that attaches a counter value to debug actions and enables/di...
static void registerCLOptions()
Register the command line options for debug counters.
void print(raw_ostream &os) const
Print the counters that have been registered with this instance to the provided output stream.
void addCounter(StringRef actionTag, int64_t countToSkip, int64_t countToStopAfter)
Add a counter for the given action tag.
static bool isActivated()
Returns true if any of the CL options are activated.
void operator()(llvm::function_ref< void()> transform, const Action &action)
Entry point for handling actions.
Include the generated interface declarations.