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
5
namespace
mim
{
6
7
void
Error::clear
() {
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.
15
void
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
mim::Error::clear
void clear()
Definition
dbg.cpp:7
mim::Error::ack
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
dbg.h
mim
Definition
cfg.h:11
mim::print
std::ostream & print(std::ostream &os, const char *s)
Base case.
Definition
print.cpp:5
src
mim
util
dbg.cpp
Generated by
1.12.0