diff options
| author | 2021-05-16 17:06:13 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | f7a2340205b4fa2db32403f20d7b7afe32b15f33 (patch) | |
| tree | 22059632c5f3bf068e686997d833368f6c22f6ec /src/shader_recompiler/frontend/ir | |
| parent | glasm: Implement rest of shared mem (diff) | |
| download | yuzu-f7a2340205b4fa2db32403f20d7b7afe32b15f33.tar.gz yuzu-f7a2340205b4fa2db32403f20d7b7afe32b15f33.tar.xz yuzu-f7a2340205b4fa2db32403f20d7b7afe32b15f33.zip | |
shader_recompiler: GCC fixes
Fixes members of unnamed union not being accessible, and one function
without a declaration.
Diffstat (limited to 'src/shader_recompiler/frontend/ir')
| -rw-r--r-- | src/shader_recompiler/frontend/ir/abstract_syntax_list.h | 11 | ||||
| -rw-r--r-- | src/shader_recompiler/frontend/ir/post_order.cpp | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/shader_recompiler/frontend/ir/abstract_syntax_list.h b/src/shader_recompiler/frontend/ir/abstract_syntax_list.h index e9afb4d92..b61773487 100644 --- a/src/shader_recompiler/frontend/ir/abstract_syntax_list.h +++ b/src/shader_recompiler/frontend/ir/abstract_syntax_list.h | |||
| @@ -13,10 +13,6 @@ namespace Shader::IR { | |||
| 13 | class Block; | 13 | class Block; |
| 14 | 14 | ||
| 15 | struct AbstractSyntaxNode { | 15 | struct AbstractSyntaxNode { |
| 16 | struct NonTrivialDummy { | ||
| 17 | NonTrivialDummy() {} | ||
| 18 | }; | ||
| 19 | |||
| 20 | enum class Type { | 16 | enum class Type { |
| 21 | Block, | 17 | Block, |
| 22 | If, | 18 | If, |
| @@ -27,9 +23,7 @@ struct AbstractSyntaxNode { | |||
| 27 | Return, | 23 | Return, |
| 28 | Unreachable, | 24 | Unreachable, |
| 29 | }; | 25 | }; |
| 30 | Type type{}; | 26 | union Data { |
| 31 | union { | ||
| 32 | NonTrivialDummy dummy{}; | ||
| 33 | Block* block; | 27 | Block* block; |
| 34 | struct { | 28 | struct { |
| 35 | U1 cond; | 29 | U1 cond; |
| @@ -55,6 +49,9 @@ struct AbstractSyntaxNode { | |||
| 55 | Block* skip; | 49 | Block* skip; |
| 56 | } break_node; | 50 | } break_node; |
| 57 | }; | 51 | }; |
| 52 | |||
| 53 | Data data{}; | ||
| 54 | Type type{}; | ||
| 58 | }; | 55 | }; |
| 59 | using AbstractSyntaxList = std::vector<AbstractSyntaxNode>; | 56 | using AbstractSyntaxList = std::vector<AbstractSyntaxNode>; |
| 60 | 57 | ||
diff --git a/src/shader_recompiler/frontend/ir/post_order.cpp b/src/shader_recompiler/frontend/ir/post_order.cpp index 1a28df7fb..16bc44101 100644 --- a/src/shader_recompiler/frontend/ir/post_order.cpp +++ b/src/shader_recompiler/frontend/ir/post_order.cpp | |||
| @@ -20,7 +20,7 @@ BlockList PostOrder(const AbstractSyntaxNode& root) { | |||
| 20 | if (root.type != AbstractSyntaxNode::Type::Block) { | 20 | if (root.type != AbstractSyntaxNode::Type::Block) { |
| 21 | throw LogicError("First node in abstract syntax list root is not a block"); | 21 | throw LogicError("First node in abstract syntax list root is not a block"); |
| 22 | } | 22 | } |
| 23 | Block* const first_block{root.block}; | 23 | Block* const first_block{root.data.block}; |
| 24 | visited.insert(first_block); | 24 | visited.insert(first_block); |
| 25 | block_stack.push_back(first_block); | 25 | block_stack.push_back(first_block); |
| 26 | 26 | ||