diff options
| author | 2021-05-16 17:06:13 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:31 -0400 | |
| commit | f7a2340205b4fa2db32403f20d7b7afe32b15f33 (patch) | |
| tree | 22059632c5f3bf068e686997d833368f6c22f6ec | |
| 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.
7 files changed, 55 insertions, 58 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index e5c96eb7f..0a76423f4 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -212,14 +212,14 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) { | |||
| 212 | for (const IR::AbstractSyntaxNode& node : program.syntax_list) { | 212 | for (const IR::AbstractSyntaxNode& node : program.syntax_list) { |
| 213 | switch (node.type) { | 213 | switch (node.type) { |
| 214 | case IR::AbstractSyntaxNode::Type::Block: | 214 | case IR::AbstractSyntaxNode::Type::Block: |
| 215 | for (IR::Inst& inst : node.block->Instructions()) { | 215 | for (IR::Inst& inst : node.data.block->Instructions()) { |
| 216 | EmitInst(ctx, &inst); | 216 | EmitInst(ctx, &inst); |
| 217 | } | 217 | } |
| 218 | break; | 218 | break; |
| 219 | case IR::AbstractSyntaxNode::Type::If: | 219 | case IR::AbstractSyntaxNode::Type::If: |
| 220 | ctx.Add("MOV.S.CC RC,{};" | 220 | ctx.Add("MOV.S.CC RC,{};" |
| 221 | "IF NE.x;", | 221 | "IF NE.x;", |
| 222 | eval(node.if_node.cond)); | 222 | eval(node.data.if_node.cond)); |
| 223 | break; | 223 | break; |
| 224 | case IR::AbstractSyntaxNode::Type::EndIf: | 224 | case IR::AbstractSyntaxNode::Type::EndIf: |
| 225 | ctx.Add("ENDIF;"); | 225 | ctx.Add("ENDIF;"); |
| @@ -228,8 +228,8 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) { | |||
| 228 | ctx.Add("REP;"); | 228 | ctx.Add("REP;"); |
| 229 | break; | 229 | break; |
| 230 | case IR::AbstractSyntaxNode::Type::Repeat: | 230 | case IR::AbstractSyntaxNode::Type::Repeat: |
| 231 | if (node.repeat.cond.IsImmediate()) { | 231 | if (node.data.repeat.cond.IsImmediate()) { |
| 232 | if (node.repeat.cond.U1()) { | 232 | if (node.data.repeat.cond.U1()) { |
| 233 | ctx.Add("ENDREP;"); | 233 | ctx.Add("ENDREP;"); |
| 234 | } else { | 234 | } else { |
| 235 | ctx.Add("BRK;" | 235 | ctx.Add("BRK;" |
| @@ -239,18 +239,18 @@ void EmitCode(EmitContext& ctx, const IR::Program& program) { | |||
| 239 | ctx.Add("MOV.S.CC RC,{};" | 239 | ctx.Add("MOV.S.CC RC,{};" |
| 240 | "BRK (EQ.x);" | 240 | "BRK (EQ.x);" |
| 241 | "ENDREP;", | 241 | "ENDREP;", |
| 242 | eval(node.repeat.cond)); | 242 | eval(node.data.repeat.cond)); |
| 243 | } | 243 | } |
| 244 | break; | 244 | break; |
| 245 | case IR::AbstractSyntaxNode::Type::Break: | 245 | case IR::AbstractSyntaxNode::Type::Break: |
| 246 | if (node.break_node.cond.IsImmediate()) { | 246 | if (node.data.break_node.cond.IsImmediate()) { |
| 247 | if (node.break_node.cond.U1()) { | 247 | if (node.data.break_node.cond.U1()) { |
| 248 | ctx.Add("BRK;"); | 248 | ctx.Add("BRK;"); |
| 249 | } | 249 | } |
| 250 | } else { | 250 | } else { |
| 251 | ctx.Add("MOV.S.CC RC,{};" | 251 | ctx.Add("MOV.S.CC RC,{};" |
| 252 | "BRK (NE.x);", | 252 | "BRK (NE.x);", |
| 253 | eval(node.break_node.cond)); | 253 | eval(node.data.break_node.cond)); |
| 254 | } | 254 | } |
| 255 | break; | 255 | break; |
| 256 | case IR::AbstractSyntaxNode::Type::Return: | 256 | case IR::AbstractSyntaxNode::Type::Return: |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp index a32d01925..4d146d34e 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | |||
| @@ -105,7 +105,7 @@ void EmitBoundImageWrite(EmitContext&) { | |||
| 105 | throw LogicError("Unreachable instruction"); | 105 | throw LogicError("Unreachable instruction"); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | std::string Texture([[maybe_unused]] EmitContext& ctx, IR::TextureInstInfo info, | 108 | static std::string Texture([[maybe_unused]] EmitContext& ctx, IR::TextureInstInfo info, |
| 109 | [[maybe_unused]] const IR::Value& index) { | 109 | [[maybe_unused]] const IR::Value& index) { |
| 110 | // FIXME | 110 | // FIXME |
| 111 | return fmt::format("texture[{}]", info.descriptor_index); | 111 | return fmt::format("texture[{}]", info.descriptor_index); |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 881a5dc4c..9ed2af991 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -112,48 +112,48 @@ void Traverse(EmitContext& ctx, IR::Program& program) { | |||
| 112 | for (const IR::AbstractSyntaxNode& node : program.syntax_list) { | 112 | for (const IR::AbstractSyntaxNode& node : program.syntax_list) { |
| 113 | switch (node.type) { | 113 | switch (node.type) { |
| 114 | case IR::AbstractSyntaxNode::Type::Block: { | 114 | case IR::AbstractSyntaxNode::Type::Block: { |
| 115 | const Id label{node.block->Definition<Id>()}; | 115 | const Id label{node.data.block->Definition<Id>()}; |
| 116 | if (current_block) { | 116 | if (current_block) { |
| 117 | ctx.OpBranch(label); | 117 | ctx.OpBranch(label); |
| 118 | } | 118 | } |
| 119 | current_block = node.block; | 119 | current_block = node.data.block; |
| 120 | ctx.AddLabel(label); | 120 | ctx.AddLabel(label); |
| 121 | for (IR::Inst& inst : node.block->Instructions()) { | 121 | for (IR::Inst& inst : node.data.block->Instructions()) { |
| 122 | EmitInst(ctx, &inst); | 122 | EmitInst(ctx, &inst); |
| 123 | } | 123 | } |
| 124 | break; | 124 | break; |
| 125 | } | 125 | } |
| 126 | case IR::AbstractSyntaxNode::Type::If: { | 126 | case IR::AbstractSyntaxNode::Type::If: { |
| 127 | const Id if_label{node.if_node.body->Definition<Id>()}; | 127 | const Id if_label{node.data.if_node.body->Definition<Id>()}; |
| 128 | const Id endif_label{node.if_node.merge->Definition<Id>()}; | 128 | const Id endif_label{node.data.if_node.merge->Definition<Id>()}; |
| 129 | ctx.OpSelectionMerge(endif_label, spv::SelectionControlMask::MaskNone); | 129 | ctx.OpSelectionMerge(endif_label, spv::SelectionControlMask::MaskNone); |
| 130 | ctx.OpBranchConditional(ctx.Def(node.if_node.cond), if_label, endif_label); | 130 | ctx.OpBranchConditional(ctx.Def(node.data.if_node.cond), if_label, endif_label); |
| 131 | break; | 131 | break; |
| 132 | } | 132 | } |
| 133 | case IR::AbstractSyntaxNode::Type::Loop: { | 133 | case IR::AbstractSyntaxNode::Type::Loop: { |
| 134 | const Id body_label{node.loop.body->Definition<Id>()}; | 134 | const Id body_label{node.data.loop.body->Definition<Id>()}; |
| 135 | const Id continue_label{node.loop.continue_block->Definition<Id>()}; | 135 | const Id continue_label{node.data.loop.continue_block->Definition<Id>()}; |
| 136 | const Id endloop_label{node.loop.merge->Definition<Id>()}; | 136 | const Id endloop_label{node.data.loop.merge->Definition<Id>()}; |
| 137 | 137 | ||
| 138 | ctx.OpLoopMerge(endloop_label, continue_label, spv::LoopControlMask::MaskNone); | 138 | ctx.OpLoopMerge(endloop_label, continue_label, spv::LoopControlMask::MaskNone); |
| 139 | ctx.OpBranch(body_label); | 139 | ctx.OpBranch(body_label); |
| 140 | break; | 140 | break; |
| 141 | } | 141 | } |
| 142 | case IR::AbstractSyntaxNode::Type::Break: { | 142 | case IR::AbstractSyntaxNode::Type::Break: { |
| 143 | const Id break_label{node.break_node.merge->Definition<Id>()}; | 143 | const Id break_label{node.data.break_node.merge->Definition<Id>()}; |
| 144 | const Id skip_label{node.break_node.skip->Definition<Id>()}; | 144 | const Id skip_label{node.data.break_node.skip->Definition<Id>()}; |
| 145 | ctx.OpBranchConditional(ctx.Def(node.break_node.cond), break_label, skip_label); | 145 | ctx.OpBranchConditional(ctx.Def(node.data.break_node.cond), break_label, skip_label); |
| 146 | break; | 146 | break; |
| 147 | } | 147 | } |
| 148 | case IR::AbstractSyntaxNode::Type::EndIf: | 148 | case IR::AbstractSyntaxNode::Type::EndIf: |
| 149 | if (current_block) { | 149 | if (current_block) { |
| 150 | ctx.OpBranch(node.end_if.merge->Definition<Id>()); | 150 | ctx.OpBranch(node.data.end_if.merge->Definition<Id>()); |
| 151 | } | 151 | } |
| 152 | break; | 152 | break; |
| 153 | case IR::AbstractSyntaxNode::Type::Repeat: { | 153 | case IR::AbstractSyntaxNode::Type::Repeat: { |
| 154 | const Id loop_header_label{node.repeat.loop_header->Definition<Id>()}; | 154 | const Id loop_header_label{node.data.repeat.loop_header->Definition<Id>()}; |
| 155 | const Id merge_label{node.repeat.merge->Definition<Id>()}; | 155 | const Id merge_label{node.data.repeat.merge->Definition<Id>()}; |
| 156 | ctx.OpBranchConditional(ctx.Def(node.repeat.cond), loop_header_label, merge_label); | 156 | ctx.OpBranchConditional(ctx.Def(node.data.repeat.cond), loop_header_label, merge_label); |
| 157 | break; | 157 | break; |
| 158 | } | 158 | } |
| 159 | case IR::AbstractSyntaxNode::Type::Return: | 159 | case IR::AbstractSyntaxNode::Type::Return: |
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 | ||
diff --git a/src/shader_recompiler/frontend/maxwell/program.cpp b/src/shader_recompiler/frontend/maxwell/program.cpp index 017c4b8fd..ccdab1dad 100644 --- a/src/shader_recompiler/frontend/maxwell/program.cpp +++ b/src/shader_recompiler/frontend/maxwell/program.cpp | |||
| @@ -22,7 +22,7 @@ IR::BlockList GenerateBlocks(const IR::AbstractSyntaxList& syntax_list) { | |||
| 22 | })}; | 22 | })}; |
| 23 | IR::BlockList blocks(std::ranges::distance(syntax_blocks)); | 23 | IR::BlockList blocks(std::ranges::distance(syntax_blocks)); |
| 24 | std::ranges::transform(syntax_blocks, blocks.begin(), | 24 | std::ranges::transform(syntax_blocks, blocks.begin(), |
| 25 | [](const IR::AbstractSyntaxNode& node) { return node.block; }); | 25 | [](const IR::AbstractSyntaxNode& node) { return node.data.block; }); |
| 26 | return blocks; | 26 | return blocks; |
| 27 | } | 27 | } |
| 28 | 28 | ||
diff --git a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp index 836d4b8aa..83554a953 100644 --- a/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp +++ b/src/shader_recompiler/frontend/maxwell/structured_control_flow.cpp | |||
| @@ -655,8 +655,8 @@ public: | |||
| 655 | syntax_list{syntax_list_} { | 655 | syntax_list{syntax_list_} { |
| 656 | Visit(root_stmt, nullptr, nullptr); | 656 | Visit(root_stmt, nullptr, nullptr); |
| 657 | 657 | ||
| 658 | IR::Block& first_block{*syntax_list.front().block}; | 658 | IR::Block& first_block{*syntax_list.front().data.block}; |
| 659 | IR::IREmitter ir{first_block, first_block.begin()}; | 659 | IR::IREmitter ir = IR::IREmitter(first_block, first_block.begin()); |
| 660 | ir.Prologue(); | 660 | ir.Prologue(); |
| 661 | } | 661 | } |
| 662 | 662 | ||
| @@ -670,7 +670,7 @@ private: | |||
| 670 | current_block = block_pool.Create(inst_pool); | 670 | current_block = block_pool.Create(inst_pool); |
| 671 | auto& node{syntax_list.emplace_back()}; | 671 | auto& node{syntax_list.emplace_back()}; |
| 672 | node.type = IR::AbstractSyntaxNode::Type::Block; | 672 | node.type = IR::AbstractSyntaxNode::Type::Block; |
| 673 | node.block = current_block; | 673 | node.data.block = current_block; |
| 674 | }}; | 674 | }}; |
| 675 | Tree& tree{parent.children}; | 675 | Tree& tree{parent.children}; |
| 676 | for (auto it = tree.begin(); it != tree.end(); ++it) { | 676 | for (auto it = tree.begin(); it != tree.end(); ++it) { |
| @@ -713,24 +713,24 @@ private: | |||
| 713 | const size_t then_block_index{syntax_list.size()}; | 713 | const size_t then_block_index{syntax_list.size()}; |
| 714 | Visit(stmt, break_block, merge_block); | 714 | Visit(stmt, break_block, merge_block); |
| 715 | 715 | ||
| 716 | IR::Block* const then_block{syntax_list.at(then_block_index).block}; | 716 | IR::Block* const then_block{syntax_list.at(then_block_index).data.block}; |
| 717 | current_block->AddBranch(then_block); | 717 | current_block->AddBranch(then_block); |
| 718 | current_block->AddBranch(merge_block); | 718 | current_block->AddBranch(merge_block); |
| 719 | current_block = merge_block; | 719 | current_block = merge_block; |
| 720 | 720 | ||
| 721 | auto& if_node{syntax_list[if_node_index]}; | 721 | auto& if_node{syntax_list[if_node_index]}; |
| 722 | if_node.type = IR::AbstractSyntaxNode::Type::If; | 722 | if_node.type = IR::AbstractSyntaxNode::Type::If; |
| 723 | if_node.if_node.cond = cond; | 723 | if_node.data.if_node.cond = cond; |
| 724 | if_node.if_node.body = then_block; | 724 | if_node.data.if_node.body = then_block; |
| 725 | if_node.if_node.merge = merge_block; | 725 | if_node.data.if_node.merge = merge_block; |
| 726 | 726 | ||
| 727 | auto& endif_node{syntax_list.emplace_back()}; | 727 | auto& endif_node{syntax_list.emplace_back()}; |
| 728 | endif_node.type = IR::AbstractSyntaxNode::Type::EndIf; | 728 | endif_node.type = IR::AbstractSyntaxNode::Type::EndIf; |
| 729 | endif_node.end_if.merge = merge_block; | 729 | endif_node.data.end_if.merge = merge_block; |
| 730 | 730 | ||
| 731 | auto& merge{syntax_list.emplace_back()}; | 731 | auto& merge{syntax_list.emplace_back()}; |
| 732 | merge.type = IR::AbstractSyntaxNode::Type::Block; | 732 | merge.type = IR::AbstractSyntaxNode::Type::Block; |
| 733 | merge.block = merge_block; | 733 | merge.data.block = merge_block; |
| 734 | break; | 734 | break; |
| 735 | } | 735 | } |
| 736 | case StatementType::Loop: { | 736 | case StatementType::Loop: { |
| @@ -740,7 +740,7 @@ private: | |||
| 740 | } | 740 | } |
| 741 | auto& header_node{syntax_list.emplace_back()}; | 741 | auto& header_node{syntax_list.emplace_back()}; |
| 742 | header_node.type = IR::AbstractSyntaxNode::Type::Block; | 742 | header_node.type = IR::AbstractSyntaxNode::Type::Block; |
| 743 | header_node.block = loop_header_block; | 743 | header_node.data.block = loop_header_block; |
| 744 | 744 | ||
| 745 | IR::Block* const continue_block{block_pool.Create(inst_pool)}; | 745 | IR::Block* const continue_block{block_pool.Create(inst_pool)}; |
| 746 | IR::Block* const merge_block{MergeBlock(parent, stmt)}; | 746 | IR::Block* const merge_block{MergeBlock(parent, stmt)}; |
| @@ -757,7 +757,7 @@ private: | |||
| 757 | const IR::U1 cond{VisitExpr(ir, *stmt.cond)}; | 757 | const IR::U1 cond{VisitExpr(ir, *stmt.cond)}; |
| 758 | ir.DummyReference(cond); | 758 | ir.DummyReference(cond); |
| 759 | 759 | ||
| 760 | IR::Block* const body_block{syntax_list.at(body_block_index).block}; | 760 | IR::Block* const body_block{syntax_list.at(body_block_index).data.block}; |
| 761 | loop_header_block->AddBranch(body_block); | 761 | loop_header_block->AddBranch(body_block); |
| 762 | 762 | ||
| 763 | continue_block->AddBranch(loop_header_block); | 763 | continue_block->AddBranch(loop_header_block); |
| @@ -767,23 +767,23 @@ private: | |||
| 767 | 767 | ||
| 768 | auto& loop{syntax_list[loop_node_index]}; | 768 | auto& loop{syntax_list[loop_node_index]}; |
| 769 | loop.type = IR::AbstractSyntaxNode::Type::Loop; | 769 | loop.type = IR::AbstractSyntaxNode::Type::Loop; |
| 770 | loop.loop.body = body_block; | 770 | loop.data.loop.body = body_block; |
| 771 | loop.loop.continue_block = continue_block; | 771 | loop.data.loop.continue_block = continue_block; |
| 772 | loop.loop.merge = merge_block; | 772 | loop.data.loop.merge = merge_block; |
| 773 | 773 | ||
| 774 | auto& continue_block_node{syntax_list.emplace_back()}; | 774 | auto& continue_block_node{syntax_list.emplace_back()}; |
| 775 | continue_block_node.type = IR::AbstractSyntaxNode::Type::Block; | 775 | continue_block_node.type = IR::AbstractSyntaxNode::Type::Block; |
| 776 | continue_block_node.block = continue_block; | 776 | continue_block_node.data.block = continue_block; |
| 777 | 777 | ||
| 778 | auto& repeat{syntax_list.emplace_back()}; | 778 | auto& repeat{syntax_list.emplace_back()}; |
| 779 | repeat.type = IR::AbstractSyntaxNode::Type::Repeat; | 779 | repeat.type = IR::AbstractSyntaxNode::Type::Repeat; |
| 780 | repeat.repeat.cond = cond; | 780 | repeat.data.repeat.cond = cond; |
| 781 | repeat.repeat.loop_header = loop_header_block; | 781 | repeat.data.repeat.loop_header = loop_header_block; |
| 782 | repeat.repeat.merge = merge_block; | 782 | repeat.data.repeat.merge = merge_block; |
| 783 | 783 | ||
| 784 | auto& merge{syntax_list.emplace_back()}; | 784 | auto& merge{syntax_list.emplace_back()}; |
| 785 | merge.type = IR::AbstractSyntaxNode::Type::Block; | 785 | merge.type = IR::AbstractSyntaxNode::Type::Block; |
| 786 | merge.block = merge_block; | 786 | merge.data.block = merge_block; |
| 787 | break; | 787 | break; |
| 788 | } | 788 | } |
| 789 | case StatementType::Break: { | 789 | case StatementType::Break: { |
| @@ -799,13 +799,13 @@ private: | |||
| 799 | 799 | ||
| 800 | auto& break_node{syntax_list.emplace_back()}; | 800 | auto& break_node{syntax_list.emplace_back()}; |
| 801 | break_node.type = IR::AbstractSyntaxNode::Type::Break; | 801 | break_node.type = IR::AbstractSyntaxNode::Type::Break; |
| 802 | break_node.break_node.cond = cond; | 802 | break_node.data.break_node.cond = cond; |
| 803 | break_node.break_node.merge = break_block; | 803 | break_node.data.break_node.merge = break_block; |
| 804 | break_node.break_node.skip = skip_block; | 804 | break_node.data.break_node.skip = skip_block; |
| 805 | 805 | ||
| 806 | auto& merge{syntax_list.emplace_back()}; | 806 | auto& merge{syntax_list.emplace_back()}; |
| 807 | merge.type = IR::AbstractSyntaxNode::Type::Block; | 807 | merge.type = IR::AbstractSyntaxNode::Type::Block; |
| 808 | merge.block = skip_block; | 808 | merge.data.block = skip_block; |
| 809 | break; | 809 | break; |
| 810 | } | 810 | } |
| 811 | case StatementType::Return: { | 811 | case StatementType::Return: { |
| @@ -824,7 +824,7 @@ private: | |||
| 824 | 824 | ||
| 825 | auto& merge{syntax_list.emplace_back()}; | 825 | auto& merge{syntax_list.emplace_back()}; |
| 826 | merge.type = IR::AbstractSyntaxNode::Type::Block; | 826 | merge.type = IR::AbstractSyntaxNode::Type::Block; |
| 827 | merge.block = demote_block; | 827 | merge.data.block = demote_block; |
| 828 | break; | 828 | break; |
| 829 | } | 829 | } |
| 830 | case StatementType::Unreachable: { | 830 | case StatementType::Unreachable: { |