#include "systemc/utils/report.hh"
-#include "systemc/core/python.hh"
-
namespace sc_gem5
{
bool reportWarningsAsErrors = false;
-DefaultReportMessages *&
-DefaultReportMessages::top()
-{
- static DefaultReportMessages *top_ptr = nullptr;
- return top_ptr;
-}
-
-void
-DefaultReportMessages::install()
+DefaultReportMessages::DefaultReportMessages(
+ std::initializer_list<std::pair<int, const char *>> msgs)
{
for (auto &p: msgs)
sc_core::sc_report::register_id(p.first, p.second);
}
-DefaultReportMessages::DefaultReportMessages(
- std::initializer_list<std::pair<int, const char *>> msgs) :
- next(top()), msgs(msgs)
-{
- top() = this;
-}
-
-void
-DefaultReportMessages::installAll()
-{
- for (DefaultReportMessages *ptr = top(); ptr; ptr = ptr->next)
- ptr->install();
-}
-
-namespace
-{
-
-struct InstallDefaultReportMessages : public PythonReadyFunc
-{
- void run() override { DefaultReportMessages::installAll(); }
-} messageInstaller;
-
-} // anonymous namespace
-
} // namespace sc_gem5
struct DefaultReportMessages
{
- protected:
- static DefaultReportMessages *&top();
- DefaultReportMessages *next;
-
- std::initializer_list<std::pair<int, const char *>> msgs;
- void install();
-
public:
DefaultReportMessages(std::initializer_list<std::pair<int, const char *>>);
-
- static void installAll();
};
} // namespace sc_gem5