aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-gcc.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-03-09 14:37:47 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-03-10 11:40:02 +0000
commita08ac0c27aed0c6d390d03656b708eb71381a5e9 (patch)
tree2de46126aaff38e8ef503952f299f164d6788f75 /gcc/rust/rust-gcc.cc
parent865b6090a8f8981cdfc050ea2ee44abbe92de141 (diff)
downloadgcc-a08ac0c27aed0c6d390d03656b708eb71381a5e9.zip
gcc-a08ac0c27aed0c6d390d03656b708eb71381a5e9.tar.gz
gcc-a08ac0c27aed0c6d390d03656b708eb71381a5e9.tar.bz2
Add support for the rust offset intrinsic
This patch adds the initial support for generic intrinsics these are do not map directly to GCC builtins and need to be substited with their specificed types. This patch allows for custom implementation body for these functions by specifying handler functions which will generate the applicable intrinsic when asked for. Addresses #658
Diffstat (limited to 'gcc/rust/rust-gcc.cc')
-rw-r--r--gcc/rust/rust-gcc.cc23
1 files changed, 0 insertions, 23 deletions
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index 70c07c1..87affcf 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -246,8 +246,6 @@ public:
tree array_constructor_expression (tree, const std::vector<unsigned long> &,
const std::vector<tree> &, Location);
- tree pointer_offset_expression (tree base, tree offset, Location);
-
tree array_index_expression (tree array, tree index, Location);
tree call_expression (tree caller, tree fn, const std::vector<tree> &args,
@@ -1717,27 +1715,6 @@ Gcc_backend::array_constructor_expression (
return ret;
}
-// Return an expression for the address of BASE[INDEX].
-
-tree
-Gcc_backend::pointer_offset_expression (tree base_tree, tree index_tree,
- Location location)
-{
- tree element_type_tree = TREE_TYPE (TREE_TYPE (base_tree));
- if (base_tree == error_mark_node || TREE_TYPE (base_tree) == error_mark_node
- || index_tree == error_mark_node || element_type_tree == error_mark_node)
- return error_mark_node;
-
- tree element_size = TYPE_SIZE_UNIT (element_type_tree);
- index_tree
- = fold_convert_loc (location.gcc_location (), sizetype, index_tree);
- tree offset = fold_build2_loc (location.gcc_location (), MULT_EXPR, sizetype,
- index_tree, element_size);
- tree ptr = fold_build2_loc (location.gcc_location (), POINTER_PLUS_EXPR,
- TREE_TYPE (base_tree), base_tree, offset);
- return ptr;
-}
-
// Return an expression representing ARRAY[INDEX]
tree