[committed,022/103] gccrs: Add mappings for fn_once lang item

Message ID 20230221120230.596966-23-arthur.cohen@embecosm.com
State Unresolved
Headers
Series [committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Arthur Cohen Feb. 21, 2023, 12:01 p.m. UTC
  From: Philip Herron <philip.herron@embecosm.com>

gcc/rust/ChangeLog:

	* util/rust-lang-item.h: Add `fn_once` lang item.
---
 gcc/rust/util/rust-lang-item.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h
index 4d9dc8a3d3a..c7e0e5c811d 100644
--- a/gcc/rust/util/rust-lang-item.h
+++ b/gcc/rust/util/rust-lang-item.h
@@ -73,6 +73,9 @@  public:
     MUT_PTR,
     CONST_SLICE_PTR,
 
+    // functions
+    FN_ONCE,
+
     UNKNOWN,
   };
 
@@ -218,6 +221,10 @@  public:
       {
 	return ItemType::CONST_SLICE_PTR;
       }
+    else if (item.compare ("fn_once") == 0)
+      {
+	return ItemType::FN_ONCE;
+      }
 
     return ItemType::UNKNOWN;
   }
@@ -296,6 +303,8 @@  public:
 	return "mut_ptr";
       case CONST_SLICE_PTR:
 	return "const_slice_ptr";
+      case FN_ONCE:
+	return "fn_once";
 
       case UNKNOWN:
 	return "<UNKNOWN>";