aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuliano Procida <gprocida@google.com>2023-09-26 11:52:57 +0100
committerGiuliano Procida <gprocida@google.com>2023-10-31 17:04:08 +0000
commit1408012cd722df1651e5d78c17d7a256b279fa37 (patch)
tree870d7344429ade6f11c9c78bb524213f85abc831
parent7010a75158608c580606635b79666f183a838801 (diff)
downloadstg-1408012cd722df1651e5d78c17d7a256b279fa37.tar.gz
stg: make GetInterface methods const
PiperOrigin-RevId: 568489721 Change-Id: Iadbbedea8c2a66ca6afb96bc50e46e1a3c5018d3
-rw-r--r--stg.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/stg.cc b/stg.cc
index d787328..b0d2eeb 100644
--- a/stg.cc
+++ b/stg.cc
@@ -45,12 +45,12 @@ namespace stg {
namespace {
struct GetInterface {
- Interface& operator()(Interface& x) {
+ Interface& operator()(Interface& x) const {
return x;
}
template <typename Node>
- Interface& operator()(Node&) {
+ Interface& operator()(Node&) const {
Die() << "expected an Interface root node";
}
};
@@ -62,7 +62,7 @@ Id Merge(Graph& graph, const std::vector<Id>& roots, Metrics& metrics) {
unification.Reserve(graph.Limit());
std::map<std::string, Id> symbols;
std::map<std::string, Id> types;
- GetInterface get;
+ const GetInterface get;
for (auto root : roots) {
const auto& interface = graph.Apply<Interface&>(get, root);
for (const auto& x : interface.symbols) {