]> gcc.gnu.org Git - gcc.git/commitdiff
add missing copy constructors and equality interfaces
authorPhilip Herron <philip.herron@embecosm.com>
Sun, 8 Aug 2021 18:48:55 +0000 (19:48 +0100)
committerPhilip Herron <philip.herron@embecosm.com>
Sun, 8 Aug 2021 19:00:26 +0000 (20:00 +0100)
gcc/rust/util/rust-hir-map.cc
gcc/rust/util/rust-hir-map.h

index 4ffbff053745953f2ad0ed9e4611f2ccce5323cb..0f8f9027698ec8a2bb5a5c80b6242d97c3eb5e7d 100644 (file)
 namespace Rust {
 namespace Analysis {
 
-NodeMapping::NodeMapping (CrateNum crateNum, NodeId nodeId, HirId hirId,
-                         LocalDefId localDefId)
-  : crateNum (crateNum), nodeId (nodeId), hirId (hirId), localDefId (localDefId)
-{}
-
-NodeMapping::~NodeMapping () {}
-
 NodeMapping
 NodeMapping::get_error ()
 {
index ccc873bb5a64f77a66523d9dc644ca68726a3457..f689abf14a1bcf3a1021da539eb5b3cff3edf04c 100644 (file)
@@ -53,8 +53,10 @@ class NodeMapping
 {
 public:
   NodeMapping (CrateNum crateNum, NodeId nodeId, HirId hirId,
-              LocalDefId localDefId);
-  ~NodeMapping ();
+              LocalDefId localDefId)
+    : crateNum (crateNum), nodeId (nodeId), hirId (hirId),
+      localDefId (localDefId)
+  {}
 
   static NodeMapping get_error ();
 
@@ -68,6 +70,14 @@ public:
 
   std::string as_string () const;
 
+  bool is_equal (const NodeMapping &other) const
+  {
+    return get_crate_num () == other.get_crate_num ()
+          && get_nodeid () == other.get_nodeid ()
+          && get_hirid () == other.get_hirid ()
+          && get_local_defid () == other.get_local_defid ();
+  }
+
 private:
   CrateNum crateNum;
   NodeId nodeId;
This page took 0.067914 seconds and 5 git commands to generate.