MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
dbg.cpp
Go to the documentation of this file.
1#include "mim/util/dbg.h"
2
3#include <fe/loc.cpp.h>
4
5namespace mim {
6
8 num_errors_ = 0;
9 num_warnings_ = 0;
10 num_notes_ = 0;
11 msgs_.clear();
12}
13
14/// If errors occured, claim them and throw; if warnings occured, claim them and report to @p os.
15void Error::ack(std::ostream& os) {
16 auto e = std::move(*this);
17 if (e.num_errors() != 0) throw e;
18 if (e.num_warnings() != 0) print(os, "{} warning(s) encountered\n{}", e.num_warnings(), e);
19}
20
21} // namespace mim
void clear()
Definition dbg.cpp:7
void ack(std::ostream &os=std::cerr)
If errors occured, claim them and throw; if warnings occured, claim them and report to os.
Definition dbg.cpp:15
Definition cfg.h:11
std::ostream & print(std::ostream &os, const char *s)
Base case.
Definition print.cpp:5