aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-07-22 11:09:03 +0200
committerThomas Koenig <tkoenig@gcc.gnu.org>2024-07-28 19:05:44 +0200
commit0231dbacb563c2e9e0825d40952c10a529f746d6 (patch)
treead8ad528eea0898b102008f06b4455d74b684bcb
parent067ada0bfa02f39bc26324f59fe3158c6c6c8969 (diff)
downloadgcc-0231dbacb563c2e9e0825d40952c10a529f746d6.zip
gcc-0231dbacb563c2e9e0825d40952c10a529f746d6.tar.gz
gcc-0231dbacb563c2e9e0825d40952c10a529f746d6.tar.bz2
constify inchash
The following constifies parts of inchash. * inchash.h (inchash::end): Make const. (inchash::merge): Take const reference hash argument. (inchash::add_commutative): Likewise.
-rw-r--r--gcc/inchash.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/inchash.h b/gcc/inchash.h
index e88f9b5..82f50eb 100644
--- a/gcc/inchash.h
+++ b/gcc/inchash.h
@@ -46,7 +46,7 @@ class hash
}
/* End incremential hashing and provide the final value. */
- hashval_t end ()
+ hashval_t end () const
{
return val;
}
@@ -109,7 +109,7 @@ class hash
}
/* Hash in state from other inchash OTHER. */
- void merge (hash &other)
+ void merge (const hash &other)
{
merge_hash (other.val);
}
@@ -136,7 +136,7 @@ class hash
based on their value. This is useful for hashing commutative
expressions, so that A+B and B+A get the same hash. */
- void add_commutative (hash &a, hash &b)
+ void add_commutative (const hash &a, const hash &b)
{
if (a.end() > b.end())
{