public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Add mappings for range lang items
@ 2022-06-08 12:11 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:11 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:9bdc5462f218099ee5a38a4a33b375cbd1d5d732
commit 9bdc5462f218099ee5a38a4a33b375cbd1d5d732
Author: Philip Herron <philip.herron@embecosm.com>
Date: Sun Feb 20 16:31:54 2022 +0000
Add mappings for range lang items
Diff:
---
gcc/rust/util/rust-lang-item.h | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index abf210d1c46..da200e7dabe 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>";
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 12:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:11 [gcc/devel/rust/master] Add mappings for range lang items Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).