17#ifndef IR_PASS_UTILS_H_
18#define IR_PASS_UTILS_H_
20#include "ir/pass_manager.h"
21#include "lib/compile_context.h"
28inline const char *DIAGNOSTIC_COUNT_IN_PASS_TAG =
"diagnosticCountInPass";
49struct DiagnosticCountInfoState;
63 std::shared_ptr<DiagnosticCountInfoState> state)
64 : componentInfo(componentInfo), state(state) {}
65 std::string_view componentInfo;
66 std::shared_ptr<DiagnosticCountInfoState> state;
88 void emitInfo(std::string_view componentInfo);
95 std::shared_ptr<DiagnosticCountInfoState> state;
Definition compile_context.h:85
static BaseCompileContext & get()
Definition compile_context.cpp:61
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
DebugHook getDiagnosticCountInPassHook(BaseCompileContext &ctxt)
This creates a debug hook that prints information about the number of diagnostics of different levels...
Definition pass_utils.cpp:89
std::function< void(const char *manager, unsigned seqNo, const char *pass, const IR::Node *node)> DebugHook
Definition ir/pass_manager.h:38
Definition pass_utils.h:53
DiagnosticCountInfoGuard(DiagnosticCountInfoGuard &&)=delete
avoid creating moved-from object and copies that could emit spurious logs.
Definition pass_utils.h:75
void emitInfo(std::string_view componentInfo)
Definition pass_utils.cpp:100
DebugHook getPassManagerHook()
Definition pass_utils.cpp:98
DiagnosticCountInfoGuard getInfoGuard(std::string_view componentInfo)
Definition pass_utils.cpp:102
DiagnosticCountInfo(BaseCompileContext &ctxt=BaseCompileContext::get())
Definition pass_utils.cpp:95