diff options
author | Lioncash <mathew1800@gmail.com> | 2019-10-17 20:56:36 -0400 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-10-17 20:56:39 -0400 |
commit | 222f4b45ebd545375b7befb84cfff81ae024e691 (patch) | |
tree | 09e9bc9b7f9a0ab68414759f81bd827098368556 | |
parent | 7831e86c34e45cdb8608ec47823b64ff88d09ac0 (diff) |
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.
-rw-r--r-- | src/video_core/shader/ast.cpp | 4 | ||||
-rw-r--r-- | src/video_core/shader/ast.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/shader/ast.cpp b/src/video_core/shader/ast.cpp index c7d471d507..784f8f69f7 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(); diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h index d7bf118216..8183ffa3f6 100644 --- a/src/video_core/shader/ast.h +++ b/src/video_core/shader/ast.h @@ -328,7 +328,7 @@ public: void InsertReturn(Expr condition, bool kills); - std::string Print(); + std::string Print() const; void Decompile(); |