aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd/dinterpret.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/dinterpret.c')
-rw-r--r--gcc/d/dmd/dinterpret.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/gcc/d/dmd/dinterpret.c b/gcc/d/dmd/dinterpret.c
index f868790..5e71f3b 100644
--- a/gcc/d/dmd/dinterpret.c
+++ b/gcc/d/dmd/dinterpret.c
@@ -1,6 +1,6 @@
/* Compiler implementation of the D programming language
- * Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved
+ * Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved
* written by Walter Bright
* http://www.digitalmars.com
* Distributed under the Boost Software License, Version 1.0.
@@ -40,8 +40,6 @@ enum CtfeGoal
bool walkPostorder(Expression *e, StoppableVisitor *v);
Expression *interpret(Statement *s, InterState *istate);
Expression *interpret(Expression *e, InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
-Expression *semantic(Expression *e, Scope *sc);
-Initializer *semantic(Initializer *init, Scope *sc, Type *t, NeedInterpret needInterpret);
static Expression *interpret(UnionExp *pue, Expression *e, InterState *istate, CtfeGoal goal = ctfeNeedRvalue);
static Expression *interpret(UnionExp *pue, Statement *s, InterState *istate);
@@ -778,7 +776,7 @@ static Expression *interpretFunction(UnionExp *pue, FuncDeclaration *fd, InterSt
{
// error, no this. Prevent segfault.
// Here should be unreachable by the strict 'this' check in front-end.
- fd->error("need 'this' to access member %s", fd->toChars());
+ fd->error("need `this` to access member %s", fd->toChars());
return CTFEExp::cantexp;
}
@@ -802,7 +800,7 @@ static Expression *interpretFunction(UnionExp *pue, FuncDeclaration *fd, InterSt
if (!istate && (fparam->storageClass & STCout))
{
// initializing an out parameter involves writing to it.
- earg->error("global %s cannot be passed as an 'out' parameter at compile time", earg->toChars());
+ earg->error("global %s cannot be passed as an `out` parameter at compile time", earg->toChars());
return CTFEExp::cantexp;
}
// Convert all reference arguments into lvalue references
@@ -1861,7 +1859,7 @@ public:
result->op == TOKclassreference);
return;
}
- e->error("value of 'this' is not known at compile time");
+ e->error("value of `this` is not known at compile time");
result = CTFEExp::cantexp;
}
@@ -2085,7 +2083,7 @@ public:
if (!v->originalType && v->semanticRun < PASSsemanticdone) // semantic() not yet run
{
- v->semantic(NULL);
+ dsymbolSemantic(v, NULL);
if (v->type->ty == Terror)
return CTFEExp::cantexp;
}
@@ -2096,13 +2094,13 @@ public:
{
if (v->inuse)
{
- error(loc, "circular initialization of %s '%s'", v->kind(), v->toPrettyChars());
+ error(loc, "circular initialization of %s `%s`", v->kind(), v->toPrettyChars());
return CTFEExp::cantexp;
}
if (v->_scope)
{
v->inuse++;
- v->_init = ::semantic(v->_init, v->_scope, v->type, INITinterpret); // might not be run on aggregate members
+ v->_init = initializerSemantic(v->_init, v->_scope, v->type, INITinterpret); // might not be run on aggregate members
v->inuse--;
}
e = initializerToExpression(v->_init, v->type);
@@ -2196,7 +2194,7 @@ public:
e = s->dsym->type->defaultInitLiteral(loc);
if (e->op == TOKerror)
error(loc, "CTFE failed because of previous errors in %s.init", s->toChars());
- e = ::semantic(e, NULL);
+ e = expressionSemantic(e, NULL);
if (e->op == TOKerror)
e = CTFEExp::cantexp;
else // Convert NULL to CTFEExp
@@ -2394,7 +2392,7 @@ public:
if (result->op == TOKnull)
{
- e->error("null pointer dereference evaluating typeid. '%s' is null", ex->toChars());
+ e->error("null pointer dereference evaluating typeid. `%s` is null", ex->toChars());
result = CTFEExp::cantexp;
return;
}
@@ -2823,7 +2821,7 @@ public:
VarDeclaration *v = c->fields[i];
if (v->inuse)
{
- e->error("circular reference to '%s'", v->toPrettyChars());
+ e->error("circular reference to `%s`", v->toPrettyChars());
result = CTFEExp::cantexp;
return;
}
@@ -5478,7 +5476,7 @@ public:
{
if (result->op != TOKclassreference)
{
- e->error("delete on invalid class reference '%s'", result->toChars());
+ e->error("delete on invalid class reference `%s`", result->toChars());
result = CTFEExp::cantexp;
return;
}
@@ -5509,7 +5507,7 @@ public:
if (result->op != TOKaddress ||
((AddrExp *)result)->e1->op != TOKstructliteral)
{
- e->error("delete on invalid struct pointer '%s'", result->toChars());
+ e->error("delete on invalid struct pointer `%s`", result->toChars());
result = CTFEExp::cantexp;
return;
}
@@ -5540,7 +5538,7 @@ public:
{
if (result->op != TOKarrayliteral)
{
- e->error("delete on invalid struct array '%s'", result->toChars());
+ e->error("delete on invalid struct array `%s`", result->toChars());
result = CTFEExp::cantexp;
return;
}
@@ -5899,9 +5897,9 @@ public:
if (result->op != TOKaddress)
{
if (result->op == TOKnull)
- e->error("dereference of null pointer '%s'", e->e1->toChars());
+ e->error("dereference of null pointer `%s`", e->e1->toChars());
else
- e->error("dereference of invalid pointer '%s'", result->toChars());
+ e->error("dereference of invalid pointer `%s`", result->toChars());
result = CTFEExp::cantexp;
return;
}
@@ -5952,9 +5950,9 @@ public:
if (ex->op == TOKnull)
{
if (ex->type->toBasetype()->ty == Tclass)
- e->error("class '%s' is null and cannot be dereferenced", e->e1->toChars());
+ e->error("class `%s` is null and cannot be dereferenced", e->e1->toChars());
else
- e->error("CTFE internal error: null this '%s'", e->e1->toChars());
+ e->error("CTFE internal error: null this `%s`", e->e1->toChars());
result = CTFEExp::cantexp;
return;
}
@@ -6181,7 +6179,7 @@ Expression *scrubReturnValue(Loc loc, Expression *e)
}
else if (e->op == TOKvoid)
{
- error(loc, "uninitialized variable '%s' cannot be returned from CTFE", ((VoidInitExp *)e)->var->toChars());
+ error(loc, "uninitialized variable `%s` cannot be returned from CTFE", ((VoidInitExp *)e)->var->toChars());
return new ErrorExp();
}