diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-06-24 19:48:55 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-06-24 20:49:58 +0200 |
commit | 8288cd635fa0bd75a8c5f25c7a90d4a7a4acec81 (patch) | |
tree | df4f53f4d7171d7691f26ecd7c49b3fe4c3bb9a1 /gcc/d/d-codegen.cc | |
parent | d97f3bca6eec50ac4ec007d731d345db3e560c52 (diff) | |
download | gcc-8288cd635fa0bd75a8c5f25c7a90d4a7a4acec81.zip gcc-8288cd635fa0bd75a8c5f25c7a90d4a7a4acec81.tar.gz gcc-8288cd635fa0bd75a8c5f25c7a90d4a7a4acec81.tar.bz2 |
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.
Diffstat (limited to 'gcc/d/d-codegen.cc')
-rw-r--r-- | gcc/d/d-codegen.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc index 0e14654..3a20114 100644 --- a/gcc/d/d-codegen.cc +++ b/gcc/d/d-codegen.cc @@ -1626,7 +1626,7 @@ build_deref (tree exp) /* Builds pointer offset expression PTR[INDEX]. */ tree -build_array_index (tree ptr, tree index) +build_pointer_index (tree ptr, tree index) { if (error_operand_p (ptr) || error_operand_p (index)) return error_mark_node; |