2010-09-01 15:24:14 -05:00
|
|
|
import util.common.span;
|
2010-11-22 18:27:00 -06:00
|
|
|
import util.common.ty_mach;
|
2010-09-01 15:24:14 -05:00
|
|
|
import std._uint;
|
|
|
|
|
2010-11-22 18:27:00 -06:00
|
|
|
tag os {
|
|
|
|
os_win32;
|
|
|
|
os_macos;
|
|
|
|
os_linux;
|
|
|
|
}
|
|
|
|
|
|
|
|
tag arch {
|
|
|
|
arch_x86;
|
|
|
|
arch_x64;
|
|
|
|
arch_arm;
|
|
|
|
}
|
|
|
|
|
|
|
|
type cfg = rec(os os,
|
|
|
|
arch arch,
|
|
|
|
ty_mach int_type,
|
|
|
|
ty_mach uint_type,
|
|
|
|
ty_mach float_type);
|
|
|
|
|
|
|
|
obj session(cfg targ) {
|
|
|
|
|
|
|
|
fn get_targ_cfg() -> cfg {
|
|
|
|
ret targ;
|
|
|
|
}
|
|
|
|
|
2010-09-23 15:15:51 -05:00
|
|
|
fn span_err(span sp, str msg) {
|
2010-10-18 18:03:22 -05:00
|
|
|
log #fmt("%s:%u:%u:%u:%u: error: %s",
|
|
|
|
sp.filename,
|
|
|
|
sp.lo.line, sp.lo.col,
|
|
|
|
sp.hi.line, sp.hi.col,
|
|
|
|
msg);
|
2010-09-01 15:24:14 -05:00
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|
2010-09-23 15:15:51 -05:00
|
|
|
fn err(str msg) {
|
2010-10-18 18:03:22 -05:00
|
|
|
log #fmt("error: %s", msg);
|
2010-09-01 15:24:14 -05:00
|
|
|
fail;
|
|
|
|
}
|
2010-09-23 15:15:51 -05:00
|
|
|
|
2010-11-22 18:27:00 -06:00
|
|
|
fn bug(str msg) {
|
|
|
|
log #fmt("error: internal compiler error %s", msg);
|
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|
2011-03-18 14:30:44 -05:00
|
|
|
fn span_unimpl(span sp, str msg) {
|
|
|
|
log #fmt("%s:%u:%u:%u:%u: error: unimplemented %s",
|
|
|
|
sp.filename,
|
|
|
|
sp.lo.line, sp.lo.col,
|
|
|
|
sp.hi.line, sp.hi.col,
|
|
|
|
msg);
|
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|
2010-09-23 15:15:51 -05:00
|
|
|
fn unimpl(str msg) {
|
2010-10-18 18:03:22 -05:00
|
|
|
log #fmt("error: unimplemented %s", msg);
|
2010-09-23 15:15:51 -05:00
|
|
|
fail;
|
|
|
|
}
|
2010-09-01 15:24:14 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Local Variables:
|
|
|
|
// fill-column: 78;
|
|
|
|
// indent-tabs-mode: nil
|
|
|
|
// c-basic-offset: 4
|
|
|
|
// buffer-file-coding-system: utf-8-unix
|
|
|
|
// compile-command: "make -k -C ../.. 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
|
|
|
|
// End:
|