diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2025-01-06 15:53:31 +0100 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2025-01-29 10:45:07 +0000 |
commit | 47fd13da4f825706f59ffd039ce8c6cf9d4767d5 (patch) | |
tree | dc68aa9fc0d057c1b35b96f58666dcdf13a40001 /gcc | |
parent | 22d1661fd1d74922e299e35018d7e3763a0bb49c (diff) | |
download | gcc-47fd13da4f825706f59ffd039ce8c6cf9d4767d5.zip gcc-47fd13da4f825706f59ffd039ce8c6cf9d4767d5.tar.gz gcc-47fd13da4f825706f59ffd039ce8c6cf9d4767d5.tar.bz2 |
Make foreverstack debug string const
Those function should not change anything within the foreverstack, it
can therefore be made const.
gcc/rust/ChangeLog:
* resolve/rust-forever-stack.h: Make debug functions const.
* resolve/rust-forever-stack.hxx: Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/resolve/rust-forever-stack.h | 6 | ||||
-rw-r--r-- | gcc/rust/resolve/rust-forever-stack.hxx | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/gcc/rust/resolve/rust-forever-stack.h b/gcc/rust/resolve/rust-forever-stack.h index 8fc46ad..278c1a8 100644 --- a/gcc/rust/resolve/rust-forever-stack.h +++ b/gcc/rust/resolve/rust-forever-stack.h @@ -670,7 +670,7 @@ public: tl::optional<Rib &> to_rib (NodeId rib_id); tl::optional<const Rib &> to_rib (NodeId rib_id) const; - std::string as_debug_string (); + std::string as_debug_string () const; /** * Used to check if a module is a descendant of another module @@ -752,9 +752,9 @@ private: std::reference_wrapper<Node> cursor_reference; void stream_rib (std::stringstream &stream, const Rib &rib, - const std::string &next, const std::string &next_next); + const std::string &next, const std::string &next_next) const; void stream_node (std::stringstream &stream, unsigned indentation, - const Node &node); + const Node &node) const; /* Helper types and functions for `resolve_path` */ diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx index 6181c05..2b628e4 100644 --- a/gcc/rust/resolve/rust-forever-stack.hxx +++ b/gcc/rust/resolve/rust-forever-stack.hxx @@ -699,7 +699,7 @@ template <Namespace N> void ForeverStack<N>::stream_rib (std::stringstream &stream, const Rib &rib, const std::string &next, - const std::string &next_next) + const std::string &next_next) const { if (rib.get_values ().empty ()) { @@ -718,7 +718,7 @@ ForeverStack<N>::stream_rib (std::stringstream &stream, const Rib &rib, template <Namespace N> void ForeverStack<N>::stream_node (std::stringstream &stream, unsigned indentation, - const ForeverStack<N>::Node &node) + const ForeverStack<N>::Node &node) const { auto indent = std::string (indentation, ' '); auto next = std::string (indentation + 4, ' '); @@ -750,7 +750,7 @@ ForeverStack<N>::stream_node (std::stringstream &stream, unsigned indentation, template <Namespace N> std::string -ForeverStack<N>::as_debug_string () +ForeverStack<N>::as_debug_string () const { std::stringstream stream; |