PromoteSideEffectsToDecl: add decomposing 'else if's to 'if { else }'

Just as we do with for loops that need decomposing to loops, we must
also decompose 'else if's to 'else { if }' so that we can insert decls
above the condition.

Bug: tint:1300
Change-Id: Ia16f1cf351964817587d353e58a02d9ae6f8386c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/77500
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Antonio Maiorano
2022-01-24 15:18:59 +00:00
committed by Tint LUCI CQ
parent 8db439d848
commit 4183a574b0
7 changed files with 390 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
#include "src/resolver/resolver_test_helper.h"
#include "src/sem/expression.h"
#include "src/sem/for_loop_statement.h"
#include "src/sem/if_statement.h"
namespace tint {
namespace resolver {