aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-02-24 16:59:05 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-02-24 16:59:56 +0000
commit22c6bca60a9bc80c043e4da9a94cb80023dde04c (patch)
tree188edbabfaa677bf7971b44a2450f83f4ba0cfba /gcc/rust/hir
parentd8351d9168f92c997858fdb25942c05dc832f330 (diff)
downloadgcc-22c6bca60a9bc80c043e4da9a94cb80023dde04c.zip
gcc-22c6bca60a9bc80c043e4da9a94cb80023dde04c.tar.gz
gcc-22c6bca60a9bc80c043e4da9a94cb80023dde04c.tar.bz2
Add support for index lang item overloads
This reuses our code to resolve operator overloads to call into the index lang item for the array-index-expression this serves as a basis for supporting slices. Fixes #975
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index 6ec8d52..b77545a 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -4050,6 +4050,10 @@ public:
: node_mappings (expr.get_mappings ()), locus (expr.get_locus ())
{}
+ OperatorExprMeta (HIR::ArrayIndexExpr &expr)
+ : node_mappings (expr.get_mappings ()), locus (expr.get_locus ())
+ {}
+
const Analysis::NodeMapping &get_mappings () const { return node_mappings; }
Location get_locus () const { return locus; }