e1d1b08203
This splits switch() construction into two stages. - One version of Make takes an array of case-values and case-statement lists, and is responsible for reporting errors if the case-values are not unique or are improperly typed. This is what the IR generator or DSL will start with on its first encounter with the switch statement. - The other version of Make takes an array of already-processed SwitchCases and can assume the invariant that they're all correctly- typed with unique values. This is what we will have when a statement is inlined or otherwise cloned. (We still assert this invariant, for correctness' sake, but in release mode we assume it.) This CL doesn't perform any optimizations at Make time yet; it does work equivalent to how `switch` works in the IR generator today. It does improve duplicate case-label checking slightly; duplicate case labels are now reported, and duplicate `default:` labels are detected. (Multiple `default` labels won't pass the parser, but they can be constructed in DSL.) Change-Id: I537ce2c8236152d58641fb1793619d66a62c01a8 Bug: skia:11342 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372616 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> |
||
---|---|---|
.. | ||
toolchain | ||
__init__.py | ||
bench.gni | ||
BUILD.gn | ||
BUILDCONFIG.gn | ||
call.py | ||
checkdir.py | ||
checkpath.py | ||
codesign_ios.py | ||
compile_ib_files.py | ||
compile_processors.py | ||
compile_sksl_tests.py | ||
copy_git_directory.py | ||
core.gni | ||
cp.py | ||
create_sksl_fp.py | ||
dehydrate_sksl.py | ||
effects_imagefilters.gni | ||
effects.gni | ||
find_headers.py | ||
find_msvc.py | ||
find_xcode_sysroot.py | ||
flutter_defines.gni | ||
fuchsia_defines.gni | ||
gen_plist_ios.py | ||
gm.gni | ||
gn_meta_sln.py | ||
gn_to_bp_utils.py | ||
gn_to_bp.py | ||
gn_to_cmake.py | ||
gpu.gni | ||
highest_version_dir.py | ||
ios.gni | ||
is_clang.py | ||
make_gm_gni.py | ||
opts.gni | ||
pdf.gni | ||
push_to_android.py | ||
rm.py | ||
run_sksllex.py | ||
samples.gni | ||
shared_sources.gni | ||
skia.gni | ||
sksl_tests.gni | ||
sksl.gni | ||
tests.gni | ||
utils.gni | ||
xps.gni |