diff options
author | Giuliano Procida <gprocida@google.com> | 2023-09-26 11:52:57 +0100 |
---|---|---|
committer | Giuliano Procida <gprocida@google.com> | 2023-10-31 17:04:08 +0000 |
commit | 1408012cd722df1651e5d78c17d7a256b279fa37 (patch) | |
tree | 870d7344429ade6f11c9c78bb524213f85abc831 | |
parent | 7010a75158608c580606635b79666f183a838801 (diff) | |
download | stg-1408012cd722df1651e5d78c17d7a256b279fa37.tar.gz |
stg: make GetInterface methods const
PiperOrigin-RevId: 568489721
Change-Id: Iadbbedea8c2a66ca6afb96bc50e46e1a3c5018d3
-rw-r--r-- | stg.cc | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |