diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-02-20 16:31:54 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-02-22 15:17:36 +0000 |
commit | 9bdc5462f218099ee5a38a4a33b375cbd1d5d732 (patch) | |
tree | 67b9496fa16ee2c3b6da6d5e10a88566c23a1f9c /gcc/rust | |
parent | bede8222987f81b10204bf58212813331a630d73 (diff) | |
download | gcc-9bdc5462f218099ee5a38a4a33b375cbd1d5d732.zip gcc-9bdc5462f218099ee5a38a4a33b375cbd1d5d732.tar.gz gcc-9bdc5462f218099ee5a38a4a33b375cbd1d5d732.tar.bz2 |
Add mappings for range lang items
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/util/rust-lang-item.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h index abf210d..da200e7 100644 --- a/gcc/rust/util/rust-lang-item.h +++ b/gcc/rust/util/rust-lang-item.h @@ -56,6 +56,14 @@ public: DEREF, DEREF_MUT, + // https://github.com/rust-lang/rust/blob/master/library/core/src/ops/range.rs + RANGE_FULL, + RANGE, + RANGE_FROM, + RANGE_TO, + RANGE_INCLUSIVE, + RANGE_TO_INCLUSIVE, + UNKNOWN, }; @@ -157,6 +165,26 @@ public: { return ItemType::DEREF_MUT; } + else if (item.compare ("Range") == 0) + { + return ItemType::RANGE; + } + else if (item.compare ("RangeFrom") == 0) + { + return ItemType::RANGE_FROM; + } + else if (item.compare ("RangeTo") == 0) + { + return ItemType::RANGE_TO; + } + else if (item.compare ("RangeInclusive") == 0) + { + return ItemType::RANGE_INCLUSIVE; + } + else if (item.compare ("RangeToInclusive") == 0) + { + return ItemType::RANGE_TO_INCLUSIVE; + } return ItemType::UNKNOWN; } @@ -213,6 +241,18 @@ public: return "deref"; case DEREF_MUT: return "deref_mut"; + case RANGE_FULL: + return "RangeFull"; + case RANGE: + return "Range"; + case RANGE_FROM: + return "RangeFrom"; + case RANGE_TO: + return "RangeTo"; + case RANGE_INCLUSIVE: + return "RangeInclusive"; + case RANGE_TO_INCLUSIVE: + return "RangeToInclusive"; case UNKNOWN: return "<UNKNOWN>"; |