diff options
| author | 2019-10-17 20:56:36 -0400 | |
|---|---|---|
| committer | 2019-10-17 20:56:39 -0400 | |
| commit | 222f4b45ebd545375b7befb84cfff81ae024e691 (patch) | |
| tree | 09e9bc9b7f9a0ab68414759f81bd827098368556 /src | |
| parent | video_core/shader/ast: Make ExprPrinter members private (diff) | |
| download | yuzu-222f4b45ebd545375b7befb84cfff81ae024e691.tar.gz yuzu-222f4b45ebd545375b7befb84cfff81ae024e691.tar.xz yuzu-222f4b45ebd545375b7befb84cfff81ae024e691.zip | |
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.
Diffstat (limited to 'src')
| -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 c7d471d50..784f8f69f 100644 --- a/src/video_core/shader/ast.cpp +++ b/src/video_core/shader/ast.cpp | |||
| @@ -333,7 +333,7 @@ public: | |||
| 333 | inner += fmt::format("{}({}) -> break;\n", Indent(), expr_parser.GetResult()); | 333 | inner += fmt::format("{}({}) -> break;\n", Indent(), expr_parser.GetResult()); |
| 334 | } | 334 | } |
| 335 | 335 | ||
| 336 | void Visit(ASTNode& node) { | 336 | void Visit(const ASTNode& node) { |
| 337 | std::visit(*this, *node->GetInnerData()); | 337 | std::visit(*this, *node->GetInnerData()); |
| 338 | } | 338 | } |
| 339 | 339 | ||
| @@ -364,7 +364,7 @@ private: | |||
| 364 | static constexpr std::string_view spaces{" "}; | 364 | static constexpr std::string_view spaces{" "}; |
| 365 | }; | 365 | }; |
| 366 | 366 | ||
| 367 | std::string ASTManager::Print() { | 367 | std::string ASTManager::Print() const { |
| 368 | ASTPrinter printer{}; | 368 | ASTPrinter printer{}; |
| 369 | printer.Visit(main_node); | 369 | printer.Visit(main_node); |
| 370 | return printer.GetResult(); | 370 | return printer.GetResult(); |
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h index d7bf11821..8183ffa3f 100644 --- a/src/video_core/shader/ast.h +++ b/src/video_core/shader/ast.h | |||
| @@ -328,7 +328,7 @@ public: | |||
| 328 | 328 | ||
| 329 | void InsertReturn(Expr condition, bool kills); | 329 | void InsertReturn(Expr condition, bool kills); |
| 330 | 330 | ||
| 331 | std::string Print(); | 331 | std::string Print() const; |
| 332 | 332 | ||
| 333 | void Decompile(); | 333 | void Decompile(); |
| 334 | 334 | ||