From 222f4b45ebd545375b7befb84cfff81ae024e691 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 17 Oct 2019 20:56:36 -0400 Subject: video_core/shader/ast: Make ASTManager::Print a const member function Given all visiting functions never modify the nodes, we can trivially make this a const member function. --- src/video_core/shader/ast.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/video_core/shader/ast.cpp') diff --git a/src/video_core/shader/ast.cpp b/src/video_core/shader/ast.cpp index c7d471d50..784f8f69f 100644 --- a/src/video_core/shader/ast.cpp +++ b/src/video_core/shader/ast.cpp @@ -333,7 +333,7 @@ public: inner += fmt::format("{}({}) -> break;\n", Indent(), expr_parser.GetResult()); } - void Visit(ASTNode& node) { + void Visit(const ASTNode& node) { std::visit(*this, *node->GetInnerData()); } @@ -364,7 +364,7 @@ private: static constexpr std::string_view spaces{" "}; }; -std::string ASTManager::Print() { +std::string ASTManager::Print() const { ASTPrinter printer{}; printer.Visit(main_node); return printer.GetResult(); -- cgit v1.2.3