[WHLSL] Add the statement behavior checker
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Jan 2019 05:40:20 +0000 (05:40 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Jan 2019 05:40:20 +0000 (05:40 +0000)
commit65873782684e1cb52683f618278756cf3c13a21e
treefc7154317c18844de88513179c679fd15d920e0e
parent02f4cc1414b41c72a3faaf06f40d6ba3be458255
[WHLSL] Add the statement behavior checker
https://bugs.webkit.org/show_bug.cgi?id=193487

Reviewed by Dean Jackson.

This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Spec/source/index.rst#typing-statements
into C++. It is meant to replace the ReturnChecker and UnreachableCodeChecker in the reference implementation.

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed. StatementBehaviorChecker does everything that LoopChecker
does.
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
(WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
(WebCore::WHLSL::checkStatementBehavior):
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp [deleted file]
Source/WebCore/Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp [new file with mode: 0644]
Source/WebCore/Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h [moved from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h with 97% similarity]
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj