MimIR
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
7void Error::clear() { msgs_.clear(); }
8
9/// If errors occurred, claim them and throw; if warnings occurred, claim them and report to @p os.
10void Error::ack(std::ostream& os) {
11 auto e = std::move(*this);
12 if (e.num_errors() != 0) throw e;
13 if (e.num_warnings() != 0) std::print(os, "{} warning(s) encountered\n{}", e.num_warnings(), e);
14}
15
16} // namespace mim
void clear()
Definition dbg.cpp:7
void ack(std::ostream &os=std::cerr)
If errors occurred, claim them and throw; if warnings occurred, claim them and report to os.
Definition dbg.cpp:10
Definition ast.h:14