diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/util/rust-hir-map.cc | 7 | ||||
-rw-r--r-- | gcc/rust/util/rust-hir-map.h | 14 |
2 files changed, 12 insertions, 9 deletions
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc index 4ffbff0..0f8f902 100644 --- a/gcc/rust/util/rust-hir-map.cc +++ b/gcc/rust/util/rust-hir-map.cc @@ -23,13 +23,6 @@ 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 () { 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; |