diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-12-23 18:04:47 +0100 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-12-30 11:27:52 +0100 |
commit | ac78516b2758a1a0598c45d0464d18d15661c853 (patch) | |
tree | 95583273941cb437277001299771b83ca1419e4f /gcc/d/d-compiler.cc | |
parent | 8f7941ca37001773a36add8119791725aeb823ba (diff) | |
download | gcc-ac78516b2758a1a0598c45d0464d18d15661c853.zip gcc-ac78516b2758a1a0598c45d0464d18d15661c853.tar.gz gcc-ac78516b2758a1a0598c45d0464d18d15661c853.tar.bz2 |
d: Give the result of evaluated expressions a location
CST trees that were converted back to a D front-end AST node lost all
location information of the original expression. Now this is propagated
on to the literal expression.
gcc/d/ChangeLog:
* d-tree.h (d_eval_constant_expression): Add location argument.
* d-builtins.cc (d_eval_constant_expression): Give generated constants
a proper file location.
* d-compiler.cc (Compiler::paintAsType): Pass expression location to
d_eval_constant_expression.
* d-frontend.cc (eval_builtin): Likewise.
Diffstat (limited to 'gcc/d/d-compiler.cc')
-rw-r--r-- | gcc/d/d-compiler.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/d/d-compiler.cc b/gcc/d/d-compiler.cc index ffa7f78..f737d8d 100644 --- a/gcc/d/d-compiler.cc +++ b/gcc/d/d-compiler.cc @@ -133,7 +133,7 @@ Compiler::paintAsType (UnionExp *, Expression *expr, Type *type) cst = native_interpret_expr (vectype, buffer, len); - Expression *e = d_eval_constant_expression (cst); + Expression *e = d_eval_constant_expression (expr->loc, cst); gcc_assert (e != NULL && e->op == TOKvector); return e->isVectorExp ()->e1; @@ -143,7 +143,7 @@ Compiler::paintAsType (UnionExp *, Expression *expr, Type *type) /* Normal interpret cast. */ cst = native_interpret_expr (build_ctype (type), buffer, len); - Expression *e = d_eval_constant_expression (cst); + Expression *e = d_eval_constant_expression (expr->loc, cst); gcc_assert (e != NULL); return e; |