diff options
Diffstat (limited to 'gcc/rust/util/rust-mapping-common.h')
-rw-r--r-- | gcc/rust/util/rust-mapping-common.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-mapping-common.h b/gcc/rust/util/rust-mapping-common.h index 42a4e8e..27faa7f 100644 --- a/gcc/rust/util/rust-mapping-common.h +++ b/gcc/rust/util/rust-mapping-common.h @@ -50,6 +50,15 @@ struct DefId return ((uint64_t) this->crateNum << 32 | this->localDefId) < ((uint64_t) other.crateNum << 32 | other.localDefId); } + + std::string as_string () const + { + std::string buf; + buf += std::to_string (crateNum); + buf += " "; // or anything else + buf += std::to_string (localDefId); + return buf; + } }; #define UNKNOWN_CREATENUM ((uint32_t) (0)) |