diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-25 11:14:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 11:14:37 +0000 |
commit | d3a4cf93b73fb32ab8d18541cc4fa5ff7b74c8e8 (patch) | |
tree | 188edbabfaa677bf7971b44a2450f83f4ba0cfba /gcc/rust/util/rust-lang-item.h | |
parent | bf92a1012264f2544e73a7a8dd0ac1e473c7f658 (diff) | |
parent | 22c6bca60a9bc80c043e4da9a94cb80023dde04c (diff) | |
download | gcc-d3a4cf93b73fb32ab8d18541cc4fa5ff7b74c8e8.zip gcc-d3a4cf93b73fb32ab8d18541cc4fa5ff7b74c8e8.tar.gz gcc-d3a4cf93b73fb32ab8d18541cc4fa5ff7b74c8e8.tar.bz2 |
Merge #974
974: Add support for ranges and index lang items along with the TyTy::SliceType r=philberty a=philberty
This PR contains more code to begin supporting Slices which requires support
for more intrinsic, range and index lang items. More work is needed to support
slices such as the const_ptr lang item and the offset intrinsic but this is a big
PR already and adds support for more lang items along the way.
Fixes #975
Addresses #849
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Diffstat (limited to 'gcc/rust/util/rust-lang-item.h')
-rw-r--r-- | gcc/rust/util/rust-lang-item.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h index da200e7..cade09d 100644 --- a/gcc/rust/util/rust-lang-item.h +++ b/gcc/rust/util/rust-lang-item.h @@ -56,6 +56,10 @@ public: DEREF, DEREF_MUT, + // https://github.com/rust-lang/rust/blob/master/library/core/src/ops/index.rs + INDEX, + INDEX_MUT, + // https://github.com/rust-lang/rust/blob/master/library/core/src/ops/range.rs RANGE_FULL, RANGE, @@ -165,6 +169,18 @@ public: { return ItemType::DEREF_MUT; } + else if (item.compare ("index") == 0) + { + return ItemType::INDEX; + } + else if (item.compare ("index_mut") == 0) + { + return ItemType::INDEX_MUT; + } + else if (item.compare ("RangeFull") == 0) + { + return ItemType::RANGE_FULL; + } else if (item.compare ("Range") == 0) { return ItemType::RANGE; @@ -241,6 +257,10 @@ public: return "deref"; case DEREF_MUT: return "deref_mut"; + case INDEX: + return "index"; + case INDEX_MUT: + return "index_mut"; case RANGE_FULL: return "RangeFull"; case RANGE: |