]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/d/d-codegen.cc
d: Construct indexes of ARRAY_TYPE using ARRAY_REF.
authorIain Buclaw <ibuclaw@gdcproject.org>
Fri, 24 Jun 2022 17:48:55 +0000 (19:48 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 24 Jun 2022 18:49:58 +0000 (20:49 +0200)
commit8288cd635fa0bd75a8c5f25c7a90d4a7a4acec81
treedf4f53f4d7171d7691f26ecd7c49b3fe4c3bb9a1
parentd97f3bca6eec50ac4ec007d731d345db3e560c52
d: Construct indexes of ARRAY_TYPE using ARRAY_REF.

This is a small simplification over `((T *)&array)[index]', which also
allows eliding an unneccesary marking of TREE_ADDRESSABLE when the array
expression is a parameter or variable declaration.

gcc/d/ChangeLog:

* d-codegen.cc (build_array_index): Rename to...
(build_pointer_index): ...this.
* d-tree.h (build_array_index): Rename declaration to...
(build_pointer_index): ...this.
* expr.cc (ExprVisitor::visit (IndexExp *)): Construct indexes of
ARRAY_TYPE using ARRAY_REF.
(ExprVisitor::visit (SliceExp *)): Update.
* intrinsics.cc (expand_intrinsic_bt): Update.
gcc/d/d-codegen.cc
gcc/d/d-tree.h
gcc/d/expr.cc
gcc/d/intrinsics.cc