diff options
| author | 2020-12-05 11:40:14 -0500 | |
|---|---|---|
| committer | 2020-12-05 16:02:23 -0500 | |
| commit | f95602f15207851b849c57e2a2dd313a087b2493 (patch) | |
| tree | ed6122ab0a30de177acb2a59dffc8109232870ec /src/video_core/shader/ast.h | |
| parent | Merge pull request #5133 from lioncash/video-shadow2 (diff) | |
| download | yuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar.gz yuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar.xz yuzu-f95602f15207851b849c57e2a2dd313a087b2493.zip | |
video_core: Resolve more variable shadowing scenarios pt.3
Cleans out the rest of the occurrences of variable shadowing and makes
any further occurrences of shadowing compiler errors.
Diffstat (limited to 'src/video_core/shader/ast.h')
| -rw-r--r-- | src/video_core/shader/ast.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h index 8e5a22ab3..dc49b369e 100644 --- a/src/video_core/shader/ast.h +++ b/src/video_core/shader/ast.h | |||
| @@ -76,7 +76,7 @@ public: | |||
| 76 | 76 | ||
| 77 | class ASTIfThen { | 77 | class ASTIfThen { |
| 78 | public: | 78 | public: |
| 79 | explicit ASTIfThen(Expr condition) : condition{std::move(condition)} {} | 79 | explicit ASTIfThen(Expr condition_) : condition{std::move(condition_)} {} |
| 80 | Expr condition; | 80 | Expr condition; |
| 81 | ASTZipper nodes{}; | 81 | ASTZipper nodes{}; |
| 82 | }; | 82 | }; |
| @@ -88,63 +88,68 @@ public: | |||
| 88 | 88 | ||
| 89 | class ASTBlockEncoded { | 89 | class ASTBlockEncoded { |
| 90 | public: | 90 | public: |
| 91 | explicit ASTBlockEncoded(u32 start, u32 end) : start{start}, end{end} {} | 91 | explicit ASTBlockEncoded(u32 start_, u32 _) : start{start_}, end{_} {} |
| 92 | u32 start; | 92 | u32 start; |
| 93 | u32 end; | 93 | u32 end; |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | class ASTBlockDecoded { | 96 | class ASTBlockDecoded { |
| 97 | public: | 97 | public: |
| 98 | explicit ASTBlockDecoded(NodeBlock&& new_nodes) : nodes(std::move(new_nodes)) {} | 98 | explicit ASTBlockDecoded(NodeBlock&& new_nodes_) : nodes(std::move(new_nodes_)) {} |
| 99 | NodeBlock nodes; | 99 | NodeBlock nodes; |
| 100 | }; | 100 | }; |
| 101 | 101 | ||
| 102 | class ASTVarSet { | 102 | class ASTVarSet { |
| 103 | public: | 103 | public: |
| 104 | explicit ASTVarSet(u32 index, Expr condition) : index{index}, condition{std::move(condition)} {} | 104 | explicit ASTVarSet(u32 index_, Expr condition_) |
| 105 | : index{index_}, condition{std::move(condition_)} {} | ||
| 106 | |||
| 105 | u32 index; | 107 | u32 index; |
| 106 | Expr condition; | 108 | Expr condition; |
| 107 | }; | 109 | }; |
| 108 | 110 | ||
| 109 | class ASTLabel { | 111 | class ASTLabel { |
| 110 | public: | 112 | public: |
| 111 | explicit ASTLabel(u32 index) : index{index} {} | 113 | explicit ASTLabel(u32 index_) : index{index_} {} |
| 112 | u32 index; | 114 | u32 index; |
| 113 | bool unused{}; | 115 | bool unused{}; |
| 114 | }; | 116 | }; |
| 115 | 117 | ||
| 116 | class ASTGoto { | 118 | class ASTGoto { |
| 117 | public: | 119 | public: |
| 118 | explicit ASTGoto(Expr condition, u32 label) : condition{std::move(condition)}, label{label} {} | 120 | explicit ASTGoto(Expr condition_, u32 label_) |
| 121 | : condition{std::move(condition_)}, label{label_} {} | ||
| 122 | |||
| 119 | Expr condition; | 123 | Expr condition; |
| 120 | u32 label; | 124 | u32 label; |
| 121 | }; | 125 | }; |
| 122 | 126 | ||
| 123 | class ASTDoWhile { | 127 | class ASTDoWhile { |
| 124 | public: | 128 | public: |
| 125 | explicit ASTDoWhile(Expr condition) : condition{std::move(condition)} {} | 129 | explicit ASTDoWhile(Expr condition_) : condition{std::move(condition_)} {} |
| 126 | Expr condition; | 130 | Expr condition; |
| 127 | ASTZipper nodes{}; | 131 | ASTZipper nodes{}; |
| 128 | }; | 132 | }; |
| 129 | 133 | ||
| 130 | class ASTReturn { | 134 | class ASTReturn { |
| 131 | public: | 135 | public: |
| 132 | explicit ASTReturn(Expr condition, bool kills) | 136 | explicit ASTReturn(Expr condition_, bool kills_) |
| 133 | : condition{std::move(condition)}, kills{kills} {} | 137 | : condition{std::move(condition_)}, kills{kills_} {} |
| 138 | |||
| 134 | Expr condition; | 139 | Expr condition; |
| 135 | bool kills; | 140 | bool kills; |
| 136 | }; | 141 | }; |
| 137 | 142 | ||
| 138 | class ASTBreak { | 143 | class ASTBreak { |
| 139 | public: | 144 | public: |
| 140 | explicit ASTBreak(Expr condition) : condition{std::move(condition)} {} | 145 | explicit ASTBreak(Expr condition_) : condition{std::move(condition_)} {} |
| 141 | Expr condition; | 146 | Expr condition; |
| 142 | }; | 147 | }; |
| 143 | 148 | ||
| 144 | class ASTBase { | 149 | class ASTBase { |
| 145 | public: | 150 | public: |
| 146 | explicit ASTBase(ASTNode parent, ASTData data) | 151 | explicit ASTBase(ASTNode parent_, ASTData data_) |
| 147 | : data{std::move(data)}, parent{std::move(parent)} {} | 152 | : data{std::move(data_)}, parent{std::move(parent_)} {} |
| 148 | 153 | ||
| 149 | template <class U, class... Args> | 154 | template <class U, class... Args> |
| 150 | static ASTNode Make(ASTNode parent, Args&&... args) { | 155 | static ASTNode Make(ASTNode parent, Args&&... args) { |
| @@ -300,7 +305,7 @@ private: | |||
| 300 | 305 | ||
| 301 | class ASTManager final { | 306 | class ASTManager final { |
| 302 | public: | 307 | public: |
| 303 | ASTManager(bool full_decompile, bool disable_else_derivation); | 308 | explicit ASTManager(bool do_full_decompile, bool disable_else_derivation_); |
| 304 | ~ASTManager(); | 309 | ~ASTManager(); |
| 305 | 310 | ||
| 306 | ASTManager(const ASTManager& o) = delete; | 311 | ASTManager(const ASTManager& o) = delete; |