8#ifndef IR_PASS_UTILS_H_
9#define IR_PASS_UTILS_H_
11#include "ir/pass_manager.h"
12#include "lib/compile_context.h"
19inline const char *DIAGNOSTIC_COUNT_IN_PASS_TAG =
"diagnosticCountInPass";
50 friend struct DiagnosticCountInfo;
54 std::shared_ptr<DiagnosticCountInfoState> state)
55 : componentInfo(componentInfo), state(state) {}
56 std::string_view componentInfo;
57 std::shared_ptr<DiagnosticCountInfoState> state;
79 void emitInfo(std::string_view componentInfo);
86 std::shared_ptr<DiagnosticCountInfoState> state;
Definition compile_context.h:76
static BaseCompileContext & get()
Definition compile_context.cpp:50
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:13
DebugHook getDiagnosticCountInPassHook(BaseCompileContext &ctxt)
This creates a debug hook that prints information about the number of diagnostics of different levels...
Definition pass_utils.cpp:78
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:44
DiagnosticCountInfoGuard(DiagnosticCountInfoGuard &&)=delete
avoid creating moved-from object and copies that could emit spurious logs.
void emitInfo(std::string_view componentInfo)
Definition pass_utils.cpp:89
DebugHook getPassManagerHook()
Definition pass_utils.cpp:87
DiagnosticCountInfoGuard getInfoGuard(std::string_view componentInfo)
Definition pass_utils.cpp:91
DiagnosticCountInfo(BaseCompileContext &ctxt=BaseCompileContext::get())
Definition pass_utils.cpp:84
Definition pass_utils.cpp:21