diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-08-08 19:48:55 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2021-08-08 20:00:26 +0100 |
commit | 43c1ab08f070994a934d90ff4e6457eaee12c493 (patch) | |
tree | 699d3a60735d9f7751b1a2666439606e42beb2ed /gcc/rust/util/rust-hir-map.h | |
parent | c434e5fffc00ea1681e23f4e0cbc1dc2e28e8a6d (diff) | |
download | gcc-43c1ab08f070994a934d90ff4e6457eaee12c493.zip gcc-43c1ab08f070994a934d90ff4e6457eaee12c493.tar.gz gcc-43c1ab08f070994a934d90ff4e6457eaee12c493.tar.bz2 |
add missing copy constructors and equality interfaces
Diffstat (limited to 'gcc/rust/util/rust-hir-map.h')
-rw-r--r-- | gcc/rust/util/rust-hir-map.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/rust/util/rust-hir-map.h b/gcc/rust/util/rust-hir-map.h index ccc873b..f689abf 100644 --- a/gcc/rust/util/rust-hir-map.h +++ b/gcc/rust/util/rust-hir-map.h @@ -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; |