Skip to content

Commit a13e290

Browse files
committed
remove some dependence on errors.d
1 parent 078e406 commit a13e290

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

compiler/src/dmd/dmodule.d

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ import dmd.cparse;
2727
import dmd.declaration;
2828
import dmd.dmacro;
2929
import dmd.dsymbol;
30-
import dmd.errors;
30+
import dmd.errors : fatal;
3131
import dmd.errorsink;
3232
import dmd.expression;
3333
import dmd.file_manager;
3434
import dmd.func;
3535
import dmd.globals;
36+
import dmd.hdrgen : toErrMsg;
3637
import dmd.id;
3738
import dmd.identifier;
3839
import dmd.location;
@@ -503,9 +504,10 @@ extern (C++) final class Module : Package
503504
buf.writeByte('.');
504505
}
505506
buf.printf("%s\t(%s)", ident.toChars(), m.srcfile.toChars());
506-
message("import %s", buf.peekChars());
507+
auto eSink = global.errorSink;
508+
eSink.message(Loc.init, "import %s", buf.peekChars());
507509
if (loc != Loc.initial)
508-
message("(imported from %s)", loc.toChars());
510+
eSink.message(Loc.init, "(imported from %s)", loc.toChars());
509511
}
510512
if((m = m.parse()) is null) return null;
511513

@@ -615,7 +617,7 @@ extern (C++) final class Module : Package
615617
{
616618
eSink.error(loc, "unable to read module `%s`", toChars());
617619
const pkgfile = FileName.combine(FileName.sansExt(name), package_d);
618-
.errorSupplemental(loc, "Expected '%.*s' or '%.*s' in one of the following import paths:",
620+
eSink.errorSupplemental(loc, "Expected '%.*s' or '%.*s' in one of the following import paths:",
619621
cast(int)name.length, name.ptr, cast(int)pkgfile.length, pkgfile.ptr);
620622
}
621623
}

compiler/src/dmd/dtemplate.d

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import dmd.declaration;
4747
import dmd.dmodule;
4848
import dmd.dscope;
4949
import dmd.dsymbol;
50-
import dmd.errors;
50+
import dmd.errors : Classification;
5151
import dmd.errorsink;
5252
import dmd.expression;
5353
import dmd.func;
@@ -932,12 +932,13 @@ extern (C++) class TemplateInstance : ScopeDsymbol
932932

933933
// This returns a function pointer
934934
scope printFn = () {
935+
auto eSink = global.errorSink;
935936
final switch (cl)
936937
{
937938
case Classification.error:
938-
return &errorSupplemental;
939+
return &eSink.errorSupplemental;
939940
case Classification.deprecation:
940-
return &deprecationSupplemental;
941+
return &eSink.deprecationSupplemental;
941942
case Classification.gagged, Classification.warning:
942943
assert(0);
943944
}

compiler/src/dmd/dtoh.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
module dmd.dtoh;
1313

1414
import core.stdc.stdio;
15+
import core.stdc.stdarg;
1516
import core.stdc.string;
1617
import core.stdc.ctype;
1718

@@ -22,8 +23,7 @@ import dmd.dsymbolsem;
2223
import dmd.templatesem : computeOneMember;
2324
import dmd.expressionsem : toInteger;
2425
import dmd.funcsem : isVirtual;
25-
//import dmd.errors : fatal;
26-
import dmd.errors;
26+
import dmd.errors : fatal;
2727
import dmd.errorsink;
2828
import dmd.globals;
2929
import dmd.hdrgen;

0 commit comments

Comments
 (0)