d: Give the result of evaluated expressions a location
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 23 Dec 2020 17:04:47 +0000 (18:04 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 30 Dec 2020 10:27:52 +0000 (11:27 +0100)
commitac78516b2758a1a0598c45d0464d18d15661c853
tree95583273941cb437277001299771b83ca1419e4f
parent8f7941ca37001773a36add8119791725aeb823ba
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.
gcc/d/d-builtins.cc
gcc/d/d-compiler.cc
gcc/d/d-frontend.cc
gcc/d/d-tree.h