mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
gccrs: lang-item: Add LangItem::PrettyString
Which formats a lang item as it appears in source code. gcc/rust/ChangeLog: * util/rust-lang-item.cc (LangItem::PrettyString): New. * util/rust-lang-item.h: New.
This commit is contained in:
@@ -118,6 +118,12 @@ LangItem::ToString (LangItem::Kind type)
|
||||
return str.value ();
|
||||
}
|
||||
|
||||
std::string
|
||||
LangItem::PrettyString (LangItem::Kind type)
|
||||
{
|
||||
return "#[lang = \"" + LangItem::ToString (type) + "\"]";
|
||||
}
|
||||
|
||||
LangItem::Kind
|
||||
LangItem::OperatorToLangItem (ArithmeticOrLogicalOperator op)
|
||||
{
|
||||
|
||||
@@ -134,6 +134,7 @@ public:
|
||||
|
||||
static tl::optional<Kind> Parse (const std::string &item);
|
||||
static std::string ToString (Kind type);
|
||||
static std::string PrettyString (Kind type);
|
||||
static Kind OperatorToLangItem (ArithmeticOrLogicalOperator op);
|
||||
static Kind
|
||||
CompoundAssignmentOperatorToLangItem (ArithmeticOrLogicalOperator op);
|
||||
|
||||
Reference in New Issue
Block a user