forked from suyu/suyu
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.
This commit is contained in:
parent
7831e86c34
commit
222f4b45eb
2 changed files with 3 additions and 3 deletions
|
@ -333,7 +333,7 @@ public:
|
||||||
inner += fmt::format("{}({}) -> break;\n", Indent(), expr_parser.GetResult());
|
inner += fmt::format("{}({}) -> break;\n", Indent(), expr_parser.GetResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Visit(ASTNode& node) {
|
void Visit(const ASTNode& node) {
|
||||||
std::visit(*this, *node->GetInnerData());
|
std::visit(*this, *node->GetInnerData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ private:
|
||||||
static constexpr std::string_view spaces{" "};
|
static constexpr std::string_view spaces{" "};
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string ASTManager::Print() {
|
std::string ASTManager::Print() const {
|
||||||
ASTPrinter printer{};
|
ASTPrinter printer{};
|
||||||
printer.Visit(main_node);
|
printer.Visit(main_node);
|
||||||
return printer.GetResult();
|
return printer.GetResult();
|
||||||
|
|
|
@ -328,7 +328,7 @@ public:
|
||||||
|
|
||||||
void InsertReturn(Expr condition, bool kills);
|
void InsertReturn(Expr condition, bool kills);
|
||||||
|
|
||||||
std::string Print();
|
std::string Print() const;
|
||||||
|
|
||||||
void Decompile();
|
void Decompile();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue