diff options
author | Richard Biener <rguenther@suse.de> | 2024-07-22 11:09:03 +0200 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2024-07-22 13:00:30 +0200 |
commit | 1e32a8be69d3f91e45193a0a1aa0dcae7ebe0acb (patch) | |
tree | e89211db07176546f33fa132c3d660f7a30d6ee0 /gcc | |
parent | 9d8888650e97cb76e4ea3b5d060e4a4cef38fc58 (diff) | |
download | gcc-1e32a8be69d3f91e45193a0a1aa0dcae7ebe0acb.zip gcc-1e32a8be69d3f91e45193a0a1aa0dcae7ebe0acb.tar.gz gcc-1e32a8be69d3f91e45193a0a1aa0dcae7ebe0acb.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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/inchash.h | 6 |
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()) { |