On Thu, Jul 2, 2020 at 6:47 PM Zebediah Figura <zfigura(a)codeweavers.com> wrote:
On 7/2/20 11:15 AM, Matteo Bruni wrote:
On Tue, Jun 30, 2020 at 1:56 AM Zebediah Figura <z.figura12(a)gmail.com> wrote:
+{ + struct hlsl_ir_node *instr, *next; + BOOL progress = 0; + + LIST_FOR_EACH_ENTRY_SAFE(instr, next, instrs, struct hlsl_ir_node, entry) + { + if (instr->type == HLSL_IR_IF) + { + struct hlsl_ir_if *iff = if_from_node(instr); + progress |= transform_ir(func, iff->then_instrs); + if (iff->else_instrs) + progress |= transform_ir(func, iff->else_instrs); + }
I like to have a blank line between declarations and other statements.
Oops, missed that one :-/
No problem :)
+ else if (instr->type == HLSL_IR_LOOP) + progress |= transform_ir(func, loop_from_node(instr)->body);
Unrelated to the patch: maybe we should always initialize else_instrs? I think that would get rid of a bunch of checks with no drawback.
Besides another heap allocation (though maybe we could just store those inline instead? I don't think there's any reason why not), but yes, probably.
Yeah, I don't see any problem with inlining them either.