/* Compiler implementation of the D programming language
- * Copyright (C) 2018-2020 by The D Language Foundation, All Rights Reserved
+ * Copyright (C) 2018-2021 by The D Language Foundation, All Rights Reserved
* written by Iain Buclaw
* http://www.digitalmars.com
* Distributed under the Boost Software License, Version 1.0.
*/
#include "scope.h"
+#include "expression.h"
#include "declaration.h"
#include "errors.h"
#include "parse.h"
#include "statement.h"
-Expression *semantic(Expression *e, Scope *sc);
-Statement *semantic(Statement *s, Scope *sc);
-
/***********************************
* Parse list of extended asm input or output operands.
* Grammar:
s->stc = sc->stc;
// Fold the instruction template string.
- s->insn = semantic(s->insn, sc);
+ s->insn = expressionSemantic(s->insn, sc);
s->insn = s->insn->ctfeInterpret();
if (s->insn->op != TOKstring || ((StringExp *) s->insn)->sz != 1)
for (size_t i = 0; i < s->args->length; i++)
{
Expression *e = (*s->args)[i];
- e = semantic(e, sc);
+ e = expressionSemantic(e, sc);
// Check argument is a valid lvalue/rvalue.
if (i < s->outputargs)
e = e->modifiableLvalue(sc, NULL);
(*s->args)[i] = e;
e = (*s->constraints)[i];
- e = semantic(e, sc);
+ e = expressionSemantic(e, sc);
assert(e->op == TOKstring && ((StringExp *) e)->sz == 1);
(*s->constraints)[i] = e;
}
for (size_t i = 0; i < s->clobbers->length; i++)
{
Expression *e = (*s->clobbers)[i];
- e = semantic(e, sc);
+ e = expressionSemantic(e, sc);
assert(e->op == TOKstring && ((StringExp *) e)->sz == 1);
(*s->clobbers)[i] = e;
}
if (!s->gotos)
s->gotos = new GotoStatements();
s->gotos->push(gs);
- semantic(gs, sc);
+ statementSemantic(gs, sc);
}
}