Skip to content

Commit 2ed21d0

Browse files
WalterBrightthewilsonator
authored andcommitted
remove even more dependence on errors.d
1 parent e8d5ee3 commit 2ed21d0

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

compiler/src/dmd/glue/tocsym.d

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import dmd.dstruct;
3636
import dmd.dsymbol;
3737
import dmd.dsymbolsem : vtblSymbol;
3838
import dmd.dtemplate;
39-
import dmd.errors;
39+
import dmd.errorsink;
4040
import dmd.expression;
4141
import dmd.func;
4242
import dmd.funcsem;
@@ -318,7 +318,8 @@ Symbol* toSymbol(Dsymbol s)
318318

319319
if (global.params.v.tls)
320320
{
321-
message(vd.loc, "`%s` is thread local", vd.toChars());
321+
auto eSink = global.errorSink;
322+
eSink.message(vd.loc, "`%s` is thread local", vd.toChars());
322323
}
323324
}
324325
s.Sclass = SC.extern_;
@@ -421,7 +422,8 @@ Symbol* toSymbol(Dsymbol s)
421422
*/
422423
if (fd.storage_class & STC.ctfeOnly)
423424
{
424-
error(fd.loc, "function `%s` is `@__ctfe` and cannot be used at runtime", fd.toPrettyChars());
425+
auto eSink = global.errorSink;
426+
eSink.error(fd.loc, "function `%s` is `@__ctfe` and cannot be used at runtime", fd.toPrettyChars());
425427
result = null;
426428
return;
427429
}
@@ -878,6 +880,8 @@ Srcpos toSrcpos(Loc loc) nothrow
878880
private Symbol* createImport(Symbol* sym, Loc loc)
879881
{
880882
//printf("Dsymbol.createImport('%s')\n", sym.Sident.ptr);
883+
auto eSink = global.errorSink;
884+
881885
const char* n = sym.Sident.ptr;
882886
import core.stdc.stdlib : alloca;
883887
const allocLen = 6 + strlen(n) + 1 + type_paramsize(sym.Stype).sizeof*3 + 1;
@@ -891,12 +895,12 @@ private Symbol* createImport(Symbol* sym, Loc loc)
891895
int idlen;
892896
if (target.os & Target.OS.Posix)
893897
{
894-
error(loc, "cannot generate import symbol `%s` for Posix platform", n);
898+
eSink.error(loc, "cannot generate import symbol `%s` for Posix platform", n);
895899
assert(0);
896900
}
897901
else if (target.os & Target.OS.Windows && sym.Stype.Tty & mTYthread)
898902
{
899-
error(loc, "cannot generate import symbol for thread local symbol `%s`", n);
903+
eSink.error(loc, "cannot generate import symbol for thread local symbol `%s`", n);
900904
assert(0);
901905
}
902906
else if (sym.Stype.Tmangle == Mangle.stdcall && tyfunc(sym.Stype.Tty))

compiler/src/dmd/glue/toir.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ import dmd.dsymbol;
5050
import dmd.dsymbolsem : followInstantiationContext, toParentP;
5151
import dmd.expressionsem : toInteger;
5252
import dmd.dtemplate;
53-
import dmd.errors;
5453
import dmd.errorsink;
5554
import dmd.func;
5655
import dmd.funcsem;
5756
import dmd.globals : Param;
57+
import dmd.hdrgen : toErrMsg;
5858
import dmd.identifier;
5959
import dmd.id;
6060
import dmd.location;

compiler/src/dmd/glue/toobj.d

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import dmd.dsymbol;
4545
import dmd.dsymbolsem : hasPointers, hasStaticCtorOrDtor, include, isFuncHidden,
4646
isAbstract, toAlias, fillVtbl;
4747
import dmd.dtemplate;
48-
import dmd.errors;
48+
import dmd.errors : fatal;
4949
import dmd.errorsink;
5050
import dmd.expression;
5151
import dmd.expressionsem : getDsymbol, toInteger;
@@ -522,7 +522,8 @@ void toObjFile(Dsymbol ds, bool multiobj)
522522

523523
if (userDefinedSection)
524524
{
525-
error(vd.loc, "%s `%s` can only have one section attribute", vd.kind, vd.toPrettyChars);
525+
auto eSink = global.errorSink;
526+
eSink.error(vd.loc, "%s `%s` can only have one section attribute", vd.kind, vd.toPrettyChars);
526527
return 1;
527528
}
528529

0 commit comments

Comments
 (0)