diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-03-30 14:50:18 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-04-09 22:26:42 +0100 |
commit | b1f42c38f59f43c5f8377aebb9f759bc9cd768c3 (patch) | |
tree | 9b78792c8725b6e336fdf5b4ff34846cae17ceb3 /gcc | |
parent | e43a5c5373b341d217d2f5403f31f5174b8c4e2f (diff) | |
download | gcc-b1f42c38f59f43c5f8377aebb9f759bc9cd768c3.zip gcc-b1f42c38f59f43c5f8377aebb9f759bc9cd768c3.tar.gz gcc-b1f42c38f59f43c5f8377aebb9f759bc9cd768c3.tar.bz2 |
Add helper as_string for DefIds
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/util/rust-mapping-common.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-mapping-common.h b/gcc/rust/util/rust-mapping-common.h index 42a4e8e..b4380f1 100644 --- a/gcc/rust/util/rust-mapping-common.h +++ b/gcc/rust/util/rust-mapping-common.h @@ -50,6 +50,14 @@ 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 += std::to_string (localDefId); + return buf; + } }; #define UNKNOWN_CREATENUM ((uint32_t) (0)) |