Skip to content

Commit 9bdc546

Browse files
committed
Add mappings for range lang items
1 parent bede822 commit 9bdc546

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

gcc/rust/util/rust-lang-item.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ class RustLangItem
5656
DEREF,
5757
DEREF_MUT,
5858

59+
// https://github.com/rust-lang/rust/blob/master/library/core/src/ops/range.rs
60+
RANGE_FULL,
61+
RANGE,
62+
RANGE_FROM,
63+
RANGE_TO,
64+
RANGE_INCLUSIVE,
65+
RANGE_TO_INCLUSIVE,
66+
5967
UNKNOWN,
6068
};
6169

@@ -157,6 +165,26 @@ class RustLangItem
157165
{
158166
return ItemType::DEREF_MUT;
159167
}
168+
else if (item.compare ("Range") == 0)
169+
{
170+
return ItemType::RANGE;
171+
}
172+
else if (item.compare ("RangeFrom") == 0)
173+
{
174+
return ItemType::RANGE_FROM;
175+
}
176+
else if (item.compare ("RangeTo") == 0)
177+
{
178+
return ItemType::RANGE_TO;
179+
}
180+
else if (item.compare ("RangeInclusive") == 0)
181+
{
182+
return ItemType::RANGE_INCLUSIVE;
183+
}
184+
else if (item.compare ("RangeToInclusive") == 0)
185+
{
186+
return ItemType::RANGE_TO_INCLUSIVE;
187+
}
160188

161189
return ItemType::UNKNOWN;
162190
}
@@ -213,6 +241,18 @@ class RustLangItem
213241
return "deref";
214242
case DEREF_MUT:
215243
return "deref_mut";
244+
case RANGE_FULL:
245+
return "RangeFull";
246+
case RANGE:
247+
return "Range";
248+
case RANGE_FROM:
249+
return "RangeFrom";
250+
case RANGE_TO:
251+
return "RangeTo";
252+
case RANGE_INCLUSIVE:
253+
return "RangeInclusive";
254+
case RANGE_TO_INCLUSIVE:
255+
return "RangeToInclusive";
216256

217257
case UNKNOWN:
218258
return "<UNKNOWN>";

0 commit comments

Comments
 (0)