Skip to content

Commit

Permalink
use eSink in toir.d (#15476)
Browse files Browse the repository at this point in the history
* use eSink in toir.d

* use eSink in toir.d
  • Loading branch information
WalterBright authored Jul 31, 2023
1 parent f7b3fab commit b8b2b82
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/src/dmd/toir.d
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ elem *getEthis(const ref Loc loc, IRState *irs, Dsymbol fd, Dsymbol fdp = null,
{
if (!irs.sthis) // if no frame pointer for this function
{
fd.error(loc, "is a nested function and cannot be accessed from `%s`", irs.getFunc().toPrettyChars());
irs.eSink.error(loc, "`%s` is a nested function and cannot be accessed from `%s`", fd.toChars(), irs.getFunc().toPrettyChars());
return el_long(TYnptr, 0); // error recovery
}

Expand Down Expand Up @@ -381,7 +381,7 @@ elem *getEthis(const ref Loc loc, IRState *irs, Dsymbol fd, Dsymbol fdp = null,
if (!ad)
{
Lnoframe:
irs.getFunc().error(loc, "cannot get frame pointer to `%s`", fd.toPrettyChars());
irs.eSink.error(loc, "cannot get frame pointer to `%s`", fd.toPrettyChars());
return el_long(TYnptr, 0); // error recovery
}
ClassDeclaration cd = ad.isClassDeclaration();
Expand Down Expand Up @@ -854,15 +854,15 @@ void buildClosure(FuncDeclaration fd, IRState *irs)
{
/* Because the value needs to survive the end of the scope!
*/
v.error("has scoped destruction, cannot build closure");
irs.eSink.error(v.loc, "variable `%s` has scoped destruction, cannot build closure", v.toPrettyChars());
}
if (v.isargptr)
{
/* See https://issues.dlang.org/show_bug.cgi?id=2479
* This is actually a bug, but better to produce a nice
* message at compile time rather than memory corruption at runtime
*/
v.error("cannot reference variadic arguments from closure");
irs.eSink.error(v.loc, "variable `%s` cannot reference variadic arguments from closure", v.toPrettyChars());
}

/* Set Sscope to closure */
Expand Down

0 comments on commit b8b2b82

Please sign in to comment.