[WHLSL] Migrated WebGPUShadingLanguageRI to the W3C
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Oct 2018 15:54:50 +0000 (15:54 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Oct 2018 15:54:50 +0000 (15:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190555

Unreviewed.

Migrated to https://github.com/gpuweb/WHLSL/tree/master/Source

* WebGPUShadingLanguageRI/AddressSpace.js: Removed.
* WebGPUShadingLanguageRI/All.js: Removed.
* WebGPUShadingLanguageRI/AllocateAtEntryPoints.js: Removed.
* WebGPUShadingLanguageRI/AnonymousVariable.js: Removed.
* WebGPUShadingLanguageRI/ArrayRefType.js: Removed.
* WebGPUShadingLanguageRI/ArrayType.js: Removed.
* WebGPUShadingLanguageRI/Assignment.js: Removed.
* WebGPUShadingLanguageRI/AutoWrapper.js: Removed.
* WebGPUShadingLanguageRI/Block.js: Removed.
* WebGPUShadingLanguageRI/BoolLiteral.js: Removed.
* WebGPUShadingLanguageRI/Break.js: Removed.
* WebGPUShadingLanguageRI/BuiltInSemantic.js: Removed.
* WebGPUShadingLanguageRI/BuiltinMatrixGetter.js: Removed.
* WebGPUShadingLanguageRI/BuiltinMatrixSetter.js: Removed.
* WebGPUShadingLanguageRI/BuiltinVectorGetter.js: Removed.
* WebGPUShadingLanguageRI/BuiltinVectorSetter.js: Removed.
* WebGPUShadingLanguageRI/CallExpression.js: Removed.
* WebGPUShadingLanguageRI/CallFunction.js: Removed.
* WebGPUShadingLanguageRI/Casts.js: Removed.
* WebGPUShadingLanguageRI/Check.js: Removed.
* WebGPUShadingLanguageRI/CheckLiteralTypes.js: Removed.
* WebGPUShadingLanguageRI/CheckLoops.js: Removed.
* WebGPUShadingLanguageRI/CheckNativeFuncStages.js: Removed.
* WebGPUShadingLanguageRI/CheckRecursion.js: Removed.
* WebGPUShadingLanguageRI/CheckRecursiveTypes.js: Removed.
* WebGPUShadingLanguageRI/CheckReturns.js: Removed.
* WebGPUShadingLanguageRI/CheckTypesWithArguments.js: Removed.
* WebGPUShadingLanguageRI/CheckUnreachableCode.js: Removed.
* WebGPUShadingLanguageRI/CheckWrapped.js: Removed.
* WebGPUShadingLanguageRI/Checker.js: Removed.
* WebGPUShadingLanguageRI/CloneProgram.js: Removed.
* WebGPUShadingLanguageRI/CommaExpression.js: Removed.
* WebGPUShadingLanguageRI/ConstexprFolder.js: Removed.
* WebGPUShadingLanguageRI/Continue.js: Removed.
* WebGPUShadingLanguageRI/ConvertPtrToArrayRefExpression.js: Removed.
* WebGPUShadingLanguageRI/CreateLiteral.js: Removed.
* WebGPUShadingLanguageRI/CreateLiteralType.js: Removed.
* WebGPUShadingLanguageRI/DereferenceExpression.js: Removed.
* WebGPUShadingLanguageRI/DoWhileLoop.js: Removed.
* WebGPUShadingLanguageRI/DotExpression.js: Removed.
* WebGPUShadingLanguageRI/EArrayRef.js: Removed.
* WebGPUShadingLanguageRI/EBuffer.js: Removed.
* WebGPUShadingLanguageRI/EBufferBuilder.js: Removed.
* WebGPUShadingLanguageRI/EPtr.js: Removed.
* WebGPUShadingLanguageRI/EnumLiteral.js: Removed.
* WebGPUShadingLanguageRI/EnumMember.js: Removed.
* WebGPUShadingLanguageRI/EnumType.js: Removed.
* WebGPUShadingLanguageRI/EvaluationCommon.js: Removed.
* WebGPUShadingLanguageRI/Evaluator.js: Removed.
* WebGPUShadingLanguageRI/Expression.js: Removed.
* WebGPUShadingLanguageRI/ExpressionFinder.js: Removed.
* WebGPUShadingLanguageRI/ExternalOrigin.js: Removed.
* WebGPUShadingLanguageRI/Field.js: Removed.
* WebGPUShadingLanguageRI/FindHighZombies.js: Removed.
* WebGPUShadingLanguageRI/FlattenedStructOffsetGatherer.js: Removed.
* WebGPUShadingLanguageRI/FloatLiteral.js: Removed.
* WebGPUShadingLanguageRI/FloatLiteralType.js: Removed.
* WebGPUShadingLanguageRI/FoldConstexprs.js: Removed.
* WebGPUShadingLanguageRI/ForLoop.js: Removed.
* WebGPUShadingLanguageRI/Func.js: Removed.
* WebGPUShadingLanguageRI/FuncAttribute.js: Removed.
* WebGPUShadingLanguageRI/FuncDef.js: Removed.
* WebGPUShadingLanguageRI/FuncNumThreadsAttribute.js: Removed.
* WebGPUShadingLanguageRI/FuncParameter.js: Removed.
* WebGPUShadingLanguageRI/FunctionLikeBlock.js: Removed.
* WebGPUShadingLanguageRI/HighZombieFinder.js: Removed.
* WebGPUShadingLanguageRI/IdentityExpression.js: Removed.
* WebGPUShadingLanguageRI/IfStatement.js: Removed.
* WebGPUShadingLanguageRI/IndexExpression.js: Removed.
* WebGPUShadingLanguageRI/InferTypesForCall.js: Removed.
* WebGPUShadingLanguageRI/Inline.js: Removed.
* WebGPUShadingLanguageRI/Inliner.js: Removed.
* WebGPUShadingLanguageRI/IntLiteral.js: Removed.
* WebGPUShadingLanguageRI/IntLiteralType.js: Removed.
* WebGPUShadingLanguageRI/Intrinsics.js: Removed.
* WebGPUShadingLanguageRI/LayoutBuffers.js: Removed.
* WebGPUShadingLanguageRI/Lexer.js: Removed.
* WebGPUShadingLanguageRI/LexerToken.js: Removed.
* WebGPUShadingLanguageRI/LiteralTypeChecker.js: Removed.
* WebGPUShadingLanguageRI/LogicalExpression.js: Removed.
* WebGPUShadingLanguageRI/LogicalNot.js: Removed.
* WebGPUShadingLanguageRI/LoopChecker.js: Removed.
* WebGPUShadingLanguageRI/MakeArrayRefExpression.js: Removed.
* WebGPUShadingLanguageRI/MakePtrExpression.js: Removed.
* WebGPUShadingLanguageRI/MatrixType.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLBackend.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLCodegenAll.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLCompileResult.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLConstexprEmitter.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLFunctionDeclaration.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLFunctionDefinition.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLFunctionForwardDeclaration.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLInsertTrapParameter.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLNameMangler.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLNativeFunctionCall.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLStatementEmitter.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLTypeAttributes.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLTypeAttributesMap.js: Removed.
* WebGPUShadingLanguageRI/Metal/MSLTypeUnifier.js: Removed.
* WebGPUShadingLanguageRI/Metal/TypeOf.js: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/.gitignore: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/AppDelegate.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/AppDelegate.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Assets.xcassets/AppIcon.appiconset/Contents.json: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Assets.xcassets/Contents.json: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Base.lproj/Main.storyboard: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CompileResult.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CompileResult.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Compiler.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Compiler.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CustomMetalView.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CustomMetalView.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Default.whlsl: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Julia.whlsl: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Mandelbrot.whlsl: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Info.plist: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OffscreenRenderer.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OffscreenRenderer.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OnscreenRenderer.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OnscreenRenderer.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/Renderer.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/Renderer.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestCallArgument.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestCallArgument.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestDescription.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestDescription.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamily.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamily.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamilyRunner.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamilyRunner.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/ViewController.h: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/ViewController.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/WHLSL.entitlements: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/_SharedMetal.txt: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/main.m: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL Tests.xcodeproj/project.pbxproj: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL ToyTests/Info.plist: Removed.
* WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL ToyTests/WHLSL_ToyTests.m: Removed.
* WebGPUShadingLanguageRI/Metal/WhlslToMsl.html: Removed.
* WebGPUShadingLanguageRI/Metal/WhlslToMsl.js: Removed.
* WebGPUShadingLanguageRI/NameContext.js: Removed.
* WebGPUShadingLanguageRI/NameFinder.js: Removed.
* WebGPUShadingLanguageRI/NameResolver.js: Removed.
* WebGPUShadingLanguageRI/NativeFunc.js: Removed.
* WebGPUShadingLanguageRI/NativeType.js: Removed.
* WebGPUShadingLanguageRI/Node.js: Removed.
* WebGPUShadingLanguageRI/NormalUsePropertyResolver.js: Removed.
* WebGPUShadingLanguageRI/NullLiteral.js: Removed.
* WebGPUShadingLanguageRI/NullType.js: Removed.
* WebGPUShadingLanguageRI/OperatorAnderIndexer.js: Removed.
* WebGPUShadingLanguageRI/OperatorArrayRefLength.js: Removed.
* WebGPUShadingLanguageRI/OriginKind.js: Removed.
* WebGPUShadingLanguageRI/OverloadResolutionFailure.js: Removed.
* WebGPUShadingLanguageRI/Parse.js: Removed.
* WebGPUShadingLanguageRI/Prepare.js: Removed.
* WebGPUShadingLanguageRI/Program.js: Removed.
* WebGPUShadingLanguageRI/ProgramWithUnnecessaryThingsRemoved.js: Removed.
* WebGPUShadingLanguageRI/PropertyAccessExpression.js: Removed.
* WebGPUShadingLanguageRI/PropertyResolver.js: Removed.
* WebGPUShadingLanguageRI/PtrType.js: Removed.
* WebGPUShadingLanguageRI/ReadModifyWriteExpression.js: Removed.
* WebGPUShadingLanguageRI/RecursionChecker.js: Removed.
* WebGPUShadingLanguageRI/RecursiveTypeChecker.js: Removed.
* WebGPUShadingLanguageRI/ReferenceType.js: Removed.
* WebGPUShadingLanguageRI/ResolveNames.js: Removed.
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js: Removed.
* WebGPUShadingLanguageRI/ResolveProperties.js: Removed.
* WebGPUShadingLanguageRI/ResolveTypeDefs.js: Removed.
* WebGPUShadingLanguageRI/ResourceSemantic.js: Removed.
* WebGPUShadingLanguageRI/Return.js: Removed.
* WebGPUShadingLanguageRI/ReturnChecker.js: Removed.
* WebGPUShadingLanguageRI/ReturnException.js: Removed.
* WebGPUShadingLanguageRI/Rewriter.js: Removed.
* WebGPUShadingLanguageRI/SPIR-V.js: Removed.
* WebGPUShadingLanguageRI/SPIRV.html: Removed.
* WebGPUShadingLanguageRI/SPIRVCodegen.js: Removed.
* WebGPUShadingLanguageRI/SPIRVTypeAnalyzer.js: Removed.
* WebGPUShadingLanguageRI/SPIRVVariableAnalyzer.js: Removed.
* WebGPUShadingLanguageRI/Sampler.js: Removed.
* WebGPUShadingLanguageRI/Semantic.js: Removed.
* WebGPUShadingLanguageRI/SpecializationConstantSemantic.js: Removed.
* WebGPUShadingLanguageRI/StageInOutSemantic.js: Removed.
* WebGPUShadingLanguageRI/StandardLibrary.js: Removed.
* WebGPUShadingLanguageRI/StatementCloner.js: Removed.
* WebGPUShadingLanguageRI/StructLayoutBuilder.js: Removed.
* WebGPUShadingLanguageRI/StructType.js: Removed.
* WebGPUShadingLanguageRI/SwitchCase.js: Removed.
* WebGPUShadingLanguageRI/SwitchStatement.js: Removed.
* WebGPUShadingLanguageRI/SynthesizeArrayOperatorLength.js: Removed.
* WebGPUShadingLanguageRI/SynthesizeCopyConstructorOperator.js: Removed.
* WebGPUShadingLanguageRI/SynthesizeDefaultConstructorOperator.js: Removed.
* WebGPUShadingLanguageRI/SynthesizeEnumFunctions.js: Removed.
* WebGPUShadingLanguageRI/SynthesizeStructAccessors.js: Removed.
* WebGPUShadingLanguageRI/TernaryExpression.js: Removed.
* WebGPUShadingLanguageRI/Test.html: Removed.
* WebGPUShadingLanguageRI/Test.js: Removed.
* WebGPUShadingLanguageRI/Texture.js: Removed.
* WebGPUShadingLanguageRI/TextureOperations.js: Removed.
* WebGPUShadingLanguageRI/TrapStatement.js: Removed.
* WebGPUShadingLanguageRI/Type.js: Removed.
* WebGPUShadingLanguageRI/TypeDef.js: Removed.
* WebGPUShadingLanguageRI/TypeDefResolver.js: Removed.
* WebGPUShadingLanguageRI/TypeOverloadResolutionFailure.js: Removed.
* WebGPUShadingLanguageRI/TypeRef.js: Removed.
* WebGPUShadingLanguageRI/TypedValue.js: Removed.
* WebGPUShadingLanguageRI/UintLiteral.js: Removed.
* WebGPUShadingLanguageRI/UintLiteralType.js: Removed.
* WebGPUShadingLanguageRI/UnificationContext.js: Removed.
* WebGPUShadingLanguageRI/UnreachableCodeChecker.js: Removed.
* WebGPUShadingLanguageRI/Value.js: Removed.
* WebGPUShadingLanguageRI/VariableDecl.js: Removed.
* WebGPUShadingLanguageRI/VariableRef.js: Removed.
* WebGPUShadingLanguageRI/VectorType.js: Removed.
* WebGPUShadingLanguageRI/VisitingSet.js: Removed.
* WebGPUShadingLanguageRI/Visitor.js: Removed.
* WebGPUShadingLanguageRI/WLexicalError.js: Removed.
* WebGPUShadingLanguageRI/WSyntaxError.js: Removed.
* WebGPUShadingLanguageRI/WTrapError.js: Removed.
* WebGPUShadingLanguageRI/WTypeError.js: Removed.
* WebGPUShadingLanguageRI/WhileLoop.js: Removed.
* WebGPUShadingLanguageRI/WrapChecker.js: Removed.
* WebGPUShadingLanguageRI/index.html: Removed.
* WebGPUShadingLanguageRI/spirv.core.grammar.json: Removed.
* WebGPUShadingLanguageRI/wsl-tests.yaml: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237115 268f45cc-cd09-0410-ab3c-d52691b4dbfc

225 files changed:
Tools/ChangeLog
Tools/WebGPUShadingLanguageRI/AddressSpace.js [deleted file]
Tools/WebGPUShadingLanguageRI/All.js [deleted file]
Tools/WebGPUShadingLanguageRI/AllocateAtEntryPoints.js [deleted file]
Tools/WebGPUShadingLanguageRI/AnonymousVariable.js [deleted file]
Tools/WebGPUShadingLanguageRI/ArrayRefType.js [deleted file]
Tools/WebGPUShadingLanguageRI/ArrayType.js [deleted file]
Tools/WebGPUShadingLanguageRI/Assignment.js [deleted file]
Tools/WebGPUShadingLanguageRI/AutoWrapper.js [deleted file]
Tools/WebGPUShadingLanguageRI/Block.js [deleted file]
Tools/WebGPUShadingLanguageRI/BoolLiteral.js [deleted file]
Tools/WebGPUShadingLanguageRI/Break.js [deleted file]
Tools/WebGPUShadingLanguageRI/BuiltInSemantic.js [deleted file]
Tools/WebGPUShadingLanguageRI/BuiltinMatrixGetter.js [deleted file]
Tools/WebGPUShadingLanguageRI/BuiltinMatrixSetter.js [deleted file]
Tools/WebGPUShadingLanguageRI/BuiltinVectorGetter.js [deleted file]
Tools/WebGPUShadingLanguageRI/BuiltinVectorSetter.js [deleted file]
Tools/WebGPUShadingLanguageRI/CallExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/CallFunction.js [deleted file]
Tools/WebGPUShadingLanguageRI/Casts.js [deleted file]
Tools/WebGPUShadingLanguageRI/Check.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckLiteralTypes.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckLoops.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckNativeFuncStages.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckRecursion.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckRecursiveTypes.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckReturns.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckTypesWithArguments.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckUnreachableCode.js [deleted file]
Tools/WebGPUShadingLanguageRI/CheckWrapped.js [deleted file]
Tools/WebGPUShadingLanguageRI/Checker.js [deleted file]
Tools/WebGPUShadingLanguageRI/CloneProgram.js [deleted file]
Tools/WebGPUShadingLanguageRI/CommaExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/ConstexprFolder.js [deleted file]
Tools/WebGPUShadingLanguageRI/Continue.js [deleted file]
Tools/WebGPUShadingLanguageRI/ConvertPtrToArrayRefExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/CreateLiteral.js [deleted file]
Tools/WebGPUShadingLanguageRI/CreateLiteralType.js [deleted file]
Tools/WebGPUShadingLanguageRI/DereferenceExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/DoWhileLoop.js [deleted file]
Tools/WebGPUShadingLanguageRI/DotExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/EArrayRef.js [deleted file]
Tools/WebGPUShadingLanguageRI/EBuffer.js [deleted file]
Tools/WebGPUShadingLanguageRI/EBufferBuilder.js [deleted file]
Tools/WebGPUShadingLanguageRI/EPtr.js [deleted file]
Tools/WebGPUShadingLanguageRI/EnumLiteral.js [deleted file]
Tools/WebGPUShadingLanguageRI/EnumMember.js [deleted file]
Tools/WebGPUShadingLanguageRI/EnumType.js [deleted file]
Tools/WebGPUShadingLanguageRI/EvaluationCommon.js [deleted file]
Tools/WebGPUShadingLanguageRI/Evaluator.js [deleted file]
Tools/WebGPUShadingLanguageRI/Expression.js [deleted file]
Tools/WebGPUShadingLanguageRI/ExpressionFinder.js [deleted file]
Tools/WebGPUShadingLanguageRI/ExternalOrigin.js [deleted file]
Tools/WebGPUShadingLanguageRI/Field.js [deleted file]
Tools/WebGPUShadingLanguageRI/FindHighZombies.js [deleted file]
Tools/WebGPUShadingLanguageRI/FlattenedStructOffsetGatherer.js [deleted file]
Tools/WebGPUShadingLanguageRI/FloatLiteral.js [deleted file]
Tools/WebGPUShadingLanguageRI/FloatLiteralType.js [deleted file]
Tools/WebGPUShadingLanguageRI/FoldConstexprs.js [deleted file]
Tools/WebGPUShadingLanguageRI/ForLoop.js [deleted file]
Tools/WebGPUShadingLanguageRI/Func.js [deleted file]
Tools/WebGPUShadingLanguageRI/FuncAttribute.js [deleted file]
Tools/WebGPUShadingLanguageRI/FuncDef.js [deleted file]
Tools/WebGPUShadingLanguageRI/FuncNumThreadsAttribute.js [deleted file]
Tools/WebGPUShadingLanguageRI/FuncParameter.js [deleted file]
Tools/WebGPUShadingLanguageRI/FunctionLikeBlock.js [deleted file]
Tools/WebGPUShadingLanguageRI/HighZombieFinder.js [deleted file]
Tools/WebGPUShadingLanguageRI/IdentityExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/IfStatement.js [deleted file]
Tools/WebGPUShadingLanguageRI/IndexExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/InferTypesForCall.js [deleted file]
Tools/WebGPUShadingLanguageRI/Inline.js [deleted file]
Tools/WebGPUShadingLanguageRI/Inliner.js [deleted file]
Tools/WebGPUShadingLanguageRI/IntLiteral.js [deleted file]
Tools/WebGPUShadingLanguageRI/IntLiteralType.js [deleted file]
Tools/WebGPUShadingLanguageRI/Intrinsics.js [deleted file]
Tools/WebGPUShadingLanguageRI/LayoutBuffers.js [deleted file]
Tools/WebGPUShadingLanguageRI/Lexer.js [deleted file]
Tools/WebGPUShadingLanguageRI/LexerToken.js [deleted file]
Tools/WebGPUShadingLanguageRI/LiteralTypeChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/LogicalExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/LogicalNot.js [deleted file]
Tools/WebGPUShadingLanguageRI/LoopChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/MakeArrayRefExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/MakePtrExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/MatrixType.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLBackend.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLCodegenAll.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLCompileResult.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLConstexprEmitter.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLFunctionDeclaration.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLFunctionDefinition.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLFunctionForwardDeclaration.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLInsertTrapParameter.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLNameMangler.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLNativeFunctionCall.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLStatementEmitter.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLTypeAttributes.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLTypeAttributesMap.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/MSLTypeUnifier.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/TypeOf.js [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/.gitignore [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/AppDelegate.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/AppDelegate.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Assets.xcassets/AppIcon.appiconset/Contents.json [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Assets.xcassets/Contents.json [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Base.lproj/Main.storyboard [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CompileResult.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CompileResult.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Compiler.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Compiler.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CustomMetalView.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CustomMetalView.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Default.whlsl [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Julia.whlsl [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Mandelbrot.whlsl [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Info.plist [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OffscreenRenderer.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OffscreenRenderer.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OnscreenRenderer.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OnscreenRenderer.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/Renderer.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/Renderer.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestCallArgument.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestCallArgument.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestDescription.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestDescription.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamily.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamily.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamilyRunner.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamilyRunner.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/ViewController.h [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/ViewController.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/WHLSL.entitlements [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/_SharedMetal.txt [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/main.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL Tests.xcodeproj/project.pbxproj [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL ToyTests/Info.plist [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL ToyTests/WHLSL_ToyTests.m [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WhlslToMsl.html [deleted file]
Tools/WebGPUShadingLanguageRI/Metal/WhlslToMsl.js [deleted file]
Tools/WebGPUShadingLanguageRI/NameContext.js [deleted file]
Tools/WebGPUShadingLanguageRI/NameFinder.js [deleted file]
Tools/WebGPUShadingLanguageRI/NameResolver.js [deleted file]
Tools/WebGPUShadingLanguageRI/NativeFunc.js [deleted file]
Tools/WebGPUShadingLanguageRI/NativeType.js [deleted file]
Tools/WebGPUShadingLanguageRI/Node.js [deleted file]
Tools/WebGPUShadingLanguageRI/NormalUsePropertyResolver.js [deleted file]
Tools/WebGPUShadingLanguageRI/NullLiteral.js [deleted file]
Tools/WebGPUShadingLanguageRI/NullType.js [deleted file]
Tools/WebGPUShadingLanguageRI/OperatorAnderIndexer.js [deleted file]
Tools/WebGPUShadingLanguageRI/OperatorArrayRefLength.js [deleted file]
Tools/WebGPUShadingLanguageRI/OriginKind.js [deleted file]
Tools/WebGPUShadingLanguageRI/OverloadResolutionFailure.js [deleted file]
Tools/WebGPUShadingLanguageRI/Parse.js [deleted file]
Tools/WebGPUShadingLanguageRI/Prepare.js [deleted file]
Tools/WebGPUShadingLanguageRI/Program.js [deleted file]
Tools/WebGPUShadingLanguageRI/ProgramWithUnnecessaryThingsRemoved.js [deleted file]
Tools/WebGPUShadingLanguageRI/PropertyAccessExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/PropertyResolver.js [deleted file]
Tools/WebGPUShadingLanguageRI/PtrType.js [deleted file]
Tools/WebGPUShadingLanguageRI/ReadModifyWriteExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/RecursionChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/RecursiveTypeChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/ReferenceType.js [deleted file]
Tools/WebGPUShadingLanguageRI/ResolveNames.js [deleted file]
Tools/WebGPUShadingLanguageRI/ResolveOverloadImpl.js [deleted file]
Tools/WebGPUShadingLanguageRI/ResolveProperties.js [deleted file]
Tools/WebGPUShadingLanguageRI/ResolveTypeDefs.js [deleted file]
Tools/WebGPUShadingLanguageRI/ResourceSemantic.js [deleted file]
Tools/WebGPUShadingLanguageRI/Return.js [deleted file]
Tools/WebGPUShadingLanguageRI/ReturnChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/ReturnException.js [deleted file]
Tools/WebGPUShadingLanguageRI/Rewriter.js [deleted file]
Tools/WebGPUShadingLanguageRI/SPIR-V.js [deleted file]
Tools/WebGPUShadingLanguageRI/SPIRV.html [deleted file]
Tools/WebGPUShadingLanguageRI/SPIRVCodegen.js [deleted file]
Tools/WebGPUShadingLanguageRI/SPIRVTypeAnalyzer.js [deleted file]
Tools/WebGPUShadingLanguageRI/SPIRVVariableAnalyzer.js [deleted file]
Tools/WebGPUShadingLanguageRI/Sampler.js [deleted file]
Tools/WebGPUShadingLanguageRI/Semantic.js [deleted file]
Tools/WebGPUShadingLanguageRI/SpecializationConstantSemantic.js [deleted file]
Tools/WebGPUShadingLanguageRI/StageInOutSemantic.js [deleted file]
Tools/WebGPUShadingLanguageRI/StandardLibrary.js [deleted file]
Tools/WebGPUShadingLanguageRI/StatementCloner.js [deleted file]
Tools/WebGPUShadingLanguageRI/StructLayoutBuilder.js [deleted file]
Tools/WebGPUShadingLanguageRI/StructType.js [deleted file]
Tools/WebGPUShadingLanguageRI/SwitchCase.js [deleted file]
Tools/WebGPUShadingLanguageRI/SwitchStatement.js [deleted file]
Tools/WebGPUShadingLanguageRI/SynthesizeArrayOperatorLength.js [deleted file]
Tools/WebGPUShadingLanguageRI/SynthesizeCopyConstructorOperator.js [deleted file]
Tools/WebGPUShadingLanguageRI/SynthesizeDefaultConstructorOperator.js [deleted file]
Tools/WebGPUShadingLanguageRI/SynthesizeEnumFunctions.js [deleted file]
Tools/WebGPUShadingLanguageRI/SynthesizeStructAccessors.js [deleted file]
Tools/WebGPUShadingLanguageRI/TernaryExpression.js [deleted file]
Tools/WebGPUShadingLanguageRI/Test.html [deleted file]
Tools/WebGPUShadingLanguageRI/Test.js [deleted file]
Tools/WebGPUShadingLanguageRI/Texture.js [deleted file]
Tools/WebGPUShadingLanguageRI/TextureOperations.js [deleted file]
Tools/WebGPUShadingLanguageRI/TrapStatement.js [deleted file]
Tools/WebGPUShadingLanguageRI/Type.js [deleted file]
Tools/WebGPUShadingLanguageRI/TypeDef.js [deleted file]
Tools/WebGPUShadingLanguageRI/TypeDefResolver.js [deleted file]
Tools/WebGPUShadingLanguageRI/TypeOverloadResolutionFailure.js [deleted file]
Tools/WebGPUShadingLanguageRI/TypeRef.js [deleted file]
Tools/WebGPUShadingLanguageRI/TypedValue.js [deleted file]
Tools/WebGPUShadingLanguageRI/UintLiteral.js [deleted file]
Tools/WebGPUShadingLanguageRI/UintLiteralType.js [deleted file]
Tools/WebGPUShadingLanguageRI/UnificationContext.js [deleted file]
Tools/WebGPUShadingLanguageRI/UnreachableCodeChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/Value.js [deleted file]
Tools/WebGPUShadingLanguageRI/VariableDecl.js [deleted file]
Tools/WebGPUShadingLanguageRI/VariableRef.js [deleted file]
Tools/WebGPUShadingLanguageRI/VectorType.js [deleted file]
Tools/WebGPUShadingLanguageRI/VisitingSet.js [deleted file]
Tools/WebGPUShadingLanguageRI/Visitor.js [deleted file]
Tools/WebGPUShadingLanguageRI/WLexicalError.js [deleted file]
Tools/WebGPUShadingLanguageRI/WSyntaxError.js [deleted file]
Tools/WebGPUShadingLanguageRI/WTrapError.js [deleted file]
Tools/WebGPUShadingLanguageRI/WTypeError.js [deleted file]
Tools/WebGPUShadingLanguageRI/WhileLoop.js [deleted file]
Tools/WebGPUShadingLanguageRI/WrapChecker.js [deleted file]
Tools/WebGPUShadingLanguageRI/index.html [deleted file]
Tools/WebGPUShadingLanguageRI/spirv.core.grammar.json [deleted file]
Tools/WebGPUShadingLanguageRI/wsl-tests.yaml [deleted file]

index a714351..b8ad5ec 100644 (file)
@@ -1,3 +1,237 @@
+2018-10-15  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [WHLSL] Migrated WebGPUShadingLanguageRI to the W3C
+        https://bugs.webkit.org/show_bug.cgi?id=190555
+
+        Unreviewed.
+
+        Migrated to https://github.com/gpuweb/WHLSL/tree/master/Source
+
+        * WebGPUShadingLanguageRI/AddressSpace.js: Removed.
+        * WebGPUShadingLanguageRI/All.js: Removed.
+        * WebGPUShadingLanguageRI/AllocateAtEntryPoints.js: Removed.
+        * WebGPUShadingLanguageRI/AnonymousVariable.js: Removed.
+        * WebGPUShadingLanguageRI/ArrayRefType.js: Removed.
+        * WebGPUShadingLanguageRI/ArrayType.js: Removed.
+        * WebGPUShadingLanguageRI/Assignment.js: Removed.
+        * WebGPUShadingLanguageRI/AutoWrapper.js: Removed.
+        * WebGPUShadingLanguageRI/Block.js: Removed.
+        * WebGPUShadingLanguageRI/BoolLiteral.js: Removed.
+        * WebGPUShadingLanguageRI/Break.js: Removed.
+        * WebGPUShadingLanguageRI/BuiltInSemantic.js: Removed.
+        * WebGPUShadingLanguageRI/BuiltinMatrixGetter.js: Removed.
+        * WebGPUShadingLanguageRI/BuiltinMatrixSetter.js: Removed.
+        * WebGPUShadingLanguageRI/BuiltinVectorGetter.js: Removed.
+        * WebGPUShadingLanguageRI/BuiltinVectorSetter.js: Removed.
+        * WebGPUShadingLanguageRI/CallExpression.js: Removed.
+        * WebGPUShadingLanguageRI/CallFunction.js: Removed.
+        * WebGPUShadingLanguageRI/Casts.js: Removed.
+        * WebGPUShadingLanguageRI/Check.js: Removed.
+        * WebGPUShadingLanguageRI/CheckLiteralTypes.js: Removed.
+        * WebGPUShadingLanguageRI/CheckLoops.js: Removed.
+        * WebGPUShadingLanguageRI/CheckNativeFuncStages.js: Removed.
+        * WebGPUShadingLanguageRI/CheckRecursion.js: Removed.
+        * WebGPUShadingLanguageRI/CheckRecursiveTypes.js: Removed.
+        * WebGPUShadingLanguageRI/CheckReturns.js: Removed.
+        * WebGPUShadingLanguageRI/CheckTypesWithArguments.js: Removed.
+        * WebGPUShadingLanguageRI/CheckUnreachableCode.js: Removed.
+        * WebGPUShadingLanguageRI/CheckWrapped.js: Removed.
+        * WebGPUShadingLanguageRI/Checker.js: Removed.
+        * WebGPUShadingLanguageRI/CloneProgram.js: Removed.
+        * WebGPUShadingLanguageRI/CommaExpression.js: Removed.
+        * WebGPUShadingLanguageRI/ConstexprFolder.js: Removed.
+        * WebGPUShadingLanguageRI/Continue.js: Removed.
+        * WebGPUShadingLanguageRI/ConvertPtrToArrayRefExpression.js: Removed.
+        * WebGPUShadingLanguageRI/CreateLiteral.js: Removed.
+        * WebGPUShadingLanguageRI/CreateLiteralType.js: Removed.
+        * WebGPUShadingLanguageRI/DereferenceExpression.js: Removed.
+        * WebGPUShadingLanguageRI/DoWhileLoop.js: Removed.
+        * WebGPUShadingLanguageRI/DotExpression.js: Removed.
+        * WebGPUShadingLanguageRI/EArrayRef.js: Removed.
+        * WebGPUShadingLanguageRI/EBuffer.js: Removed.
+        * WebGPUShadingLanguageRI/EBufferBuilder.js: Removed.
+        * WebGPUShadingLanguageRI/EPtr.js: Removed.
+        * WebGPUShadingLanguageRI/EnumLiteral.js: Removed.
+        * WebGPUShadingLanguageRI/EnumMember.js: Removed.
+        * WebGPUShadingLanguageRI/EnumType.js: Removed.
+        * WebGPUShadingLanguageRI/EvaluationCommon.js: Removed.
+        * WebGPUShadingLanguageRI/Evaluator.js: Removed.
+        * WebGPUShadingLanguageRI/Expression.js: Removed.
+        * WebGPUShadingLanguageRI/ExpressionFinder.js: Removed.
+        * WebGPUShadingLanguageRI/ExternalOrigin.js: Removed.
+        * WebGPUShadingLanguageRI/Field.js: Removed.
+        * WebGPUShadingLanguageRI/FindHighZombies.js: Removed.
+        * WebGPUShadingLanguageRI/FlattenedStructOffsetGatherer.js: Removed.
+        * WebGPUShadingLanguageRI/FloatLiteral.js: Removed.
+        * WebGPUShadingLanguageRI/FloatLiteralType.js: Removed.
+        * WebGPUShadingLanguageRI/FoldConstexprs.js: Removed.
+        * WebGPUShadingLanguageRI/ForLoop.js: Removed.
+        * WebGPUShadingLanguageRI/Func.js: Removed.
+        * WebGPUShadingLanguageRI/FuncAttribute.js: Removed.
+        * WebGPUShadingLanguageRI/FuncDef.js: Removed.
+        * WebGPUShadingLanguageRI/FuncNumThreadsAttribute.js: Removed.
+        * WebGPUShadingLanguageRI/FuncParameter.js: Removed.
+        * WebGPUShadingLanguageRI/FunctionLikeBlock.js: Removed.
+        * WebGPUShadingLanguageRI/HighZombieFinder.js: Removed.
+        * WebGPUShadingLanguageRI/IdentityExpression.js: Removed.
+        * WebGPUShadingLanguageRI/IfStatement.js: Removed.
+        * WebGPUShadingLanguageRI/IndexExpression.js: Removed.
+        * WebGPUShadingLanguageRI/InferTypesForCall.js: Removed.
+        * WebGPUShadingLanguageRI/Inline.js: Removed.
+        * WebGPUShadingLanguageRI/Inliner.js: Removed.
+        * WebGPUShadingLanguageRI/IntLiteral.js: Removed.
+        * WebGPUShadingLanguageRI/IntLiteralType.js: Removed.
+        * WebGPUShadingLanguageRI/Intrinsics.js: Removed.
+        * WebGPUShadingLanguageRI/LayoutBuffers.js: Removed.
+        * WebGPUShadingLanguageRI/Lexer.js: Removed.
+        * WebGPUShadingLanguageRI/LexerToken.js: Removed.
+        * WebGPUShadingLanguageRI/LiteralTypeChecker.js: Removed.
+        * WebGPUShadingLanguageRI/LogicalExpression.js: Removed.
+        * WebGPUShadingLanguageRI/LogicalNot.js: Removed.
+        * WebGPUShadingLanguageRI/LoopChecker.js: Removed.
+        * WebGPUShadingLanguageRI/MakeArrayRefExpression.js: Removed.
+        * WebGPUShadingLanguageRI/MakePtrExpression.js: Removed.
+        * WebGPUShadingLanguageRI/MatrixType.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLBackend.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLCodegenAll.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLCompileResult.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLConstexprEmitter.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLFunctionDeclaration.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLFunctionDefinition.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLFunctionForwardDeclaration.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLInsertTrapParameter.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLNameMangler.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLNativeFunctionCall.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLStatementEmitter.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLTypeAttributes.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLTypeAttributesMap.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/MSLTypeUnifier.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/TypeOf.js: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/.gitignore: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/AppDelegate.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/AppDelegate.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Assets.xcassets/AppIcon.appiconset/Contents.json: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Assets.xcassets/Contents.json: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Base.lproj/Main.storyboard: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CompileResult.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CompileResult.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Compiler.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Compiler.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CustomMetalView.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/CustomMetalView.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Default.whlsl: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Julia.whlsl: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Demo shaders/Mandelbrot.whlsl: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Info.plist: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OffscreenRenderer.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OffscreenRenderer.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OnscreenRenderer.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/OnscreenRenderer.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/Renderer.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/Renderer/Renderer.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestCallArgument.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestCallArgument.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestDescription.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestDescription.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamily.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamily.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamilyRunner.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/TestFamilyRunner.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/ViewController.h: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/ViewController.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/WHLSL.entitlements: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/_SharedMetal.txt: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/Core/main.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL Tests.xcodeproj/project.pbxproj: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL ToyTests/Info.plist: Removed.
+        * WebGPUShadingLanguageRI/Metal/WHLSL Tests/WHLSL ToyTests/WHLSL_ToyTests.m: Removed.
+        * WebGPUShadingLanguageRI/Metal/WhlslToMsl.html: Removed.
+        * WebGPUShadingLanguageRI/Metal/WhlslToMsl.js: Removed.
+        * WebGPUShadingLanguageRI/NameContext.js: Removed.
+        * WebGPUShadingLanguageRI/NameFinder.js: Removed.
+        * WebGPUShadingLanguageRI/NameResolver.js: Removed.
+        * WebGPUShadingLanguageRI/NativeFunc.js: Removed.
+        * WebGPUShadingLanguageRI/NativeType.js: Removed.
+        * WebGPUShadingLanguageRI/Node.js: Removed.
+        * WebGPUShadingLanguageRI/NormalUsePropertyResolver.js: Removed.
+        * WebGPUShadingLanguageRI/NullLiteral.js: Removed.
+        * WebGPUShadingLanguageRI/NullType.js: Removed.
+        * WebGPUShadingLanguageRI/OperatorAnderIndexer.js: Removed.
+        * WebGPUShadingLanguageRI/OperatorArrayRefLength.js: Removed.
+        * WebGPUShadingLanguageRI/OriginKind.js: Removed.
+        * WebGPUShadingLanguageRI/OverloadResolutionFailure.js: Removed.
+        * WebGPUShadingLanguageRI/Parse.js: Removed.
+        * WebGPUShadingLanguageRI/Prepare.js: Removed.
+        * WebGPUShadingLanguageRI/Program.js: Removed.
+        * WebGPUShadingLanguageRI/ProgramWithUnnecessaryThingsRemoved.js: Removed.
+        * WebGPUShadingLanguageRI/PropertyAccessExpression.js: Removed.
+        * WebGPUShadingLanguageRI/PropertyResolver.js: Removed.
+        * WebGPUShadingLanguageRI/PtrType.js: Removed.
+        * WebGPUShadingLanguageRI/ReadModifyWriteExpression.js: Removed.
+        * WebGPUShadingLanguageRI/RecursionChecker.js: Removed.
+        * WebGPUShadingLanguageRI/RecursiveTypeChecker.js: Removed.
+        * WebGPUShadingLanguageRI/ReferenceType.js: Removed.
+        * WebGPUShadingLanguageRI/ResolveNames.js: Removed.
+        * WebGPUShadingLanguageRI/ResolveOverloadImpl.js: Removed.
+        * WebGPUShadingLanguageRI/ResolveProperties.js: Removed.
+        * WebGPUShadingLanguageRI/ResolveTypeDefs.js: Removed.
+        * WebGPUShadingLanguageRI/ResourceSemantic.js: Removed.
+        * WebGPUShadingLanguageRI/Return.js: Removed.
+        * WebGPUShadingLanguageRI/ReturnChecker.js: Removed.
+        * WebGPUShadingLanguageRI/ReturnException.js: Removed.
+        * WebGPUShadingLanguageRI/Rewriter.js: Removed.
+        * WebGPUShadingLanguageRI/SPIR-V.js: Removed.
+        * WebGPUShadingLanguageRI/SPIRV.html: Removed.
+        * WebGPUShadingLanguageRI/SPIRVCodegen.js: Removed.
+        * WebGPUShadingLanguageRI/SPIRVTypeAnalyzer.js: Removed.
+        * WebGPUShadingLanguageRI/SPIRVVariableAnalyzer.js: Removed.
+        * WebGPUShadingLanguageRI/Sampler.js: Removed.
+        * WebGPUShadingLanguageRI/Semantic.js: Removed.
+        * WebGPUShadingLanguageRI/SpecializationConstantSemantic.js: Removed.
+        * WebGPUShadingLanguageRI/StageInOutSemantic.js: Removed.
+        * WebGPUShadingLanguageRI/StandardLibrary.js: Removed.
+        * WebGPUShadingLanguageRI/StatementCloner.js: Removed.
+        * WebGPUShadingLanguageRI/StructLayoutBuilder.js: Removed.
+        * WebGPUShadingLanguageRI/StructType.js: Removed.
+        * WebGPUShadingLanguageRI/SwitchCase.js: Removed.
+        * WebGPUShadingLanguageRI/SwitchStatement.js: Removed.
+        * WebGPUShadingLanguageRI/SynthesizeArrayOperatorLength.js: Removed.
+        * WebGPUShadingLanguageRI/SynthesizeCopyConstructorOperator.js: Removed.
+        * WebGPUShadingLanguageRI/SynthesizeDefaultConstructorOperator.js: Removed.
+        * WebGPUShadingLanguageRI/SynthesizeEnumFunctions.js: Removed.
+        * WebGPUShadingLanguageRI/SynthesizeStructAccessors.js: Removed.
+        * WebGPUShadingLanguageRI/TernaryExpression.js: Removed.
+        * WebGPUShadingLanguageRI/Test.html: Removed.
+        * WebGPUShadingLanguageRI/Test.js: Removed.
+        * WebGPUShadingLanguageRI/Texture.js: Removed.
+        * WebGPUShadingLanguageRI/TextureOperations.js: Removed.
+        * WebGPUShadingLanguageRI/TrapStatement.js: Removed.
+        * WebGPUShadingLanguageRI/Type.js: Removed.
+        * WebGPUShadingLanguageRI/TypeDef.js: Removed.
+        * WebGPUShadingLanguageRI/TypeDefResolver.js: Removed.
+        * WebGPUShadingLanguageRI/TypeOverloadResolutionFailure.js: Removed.
+        * WebGPUShadingLanguageRI/TypeRef.js: Removed.
+        * WebGPUShadingLanguageRI/TypedValue.js: Removed.
+        * WebGPUShadingLanguageRI/UintLiteral.js: Removed.
+        * WebGPUShadingLanguageRI/UintLiteralType.js: Removed.
+        * WebGPUShadingLanguageRI/UnificationContext.js: Removed.
+        * WebGPUShadingLanguageRI/UnreachableCodeChecker.js: Removed.
+        * WebGPUShadingLanguageRI/Value.js: Removed.
+        * WebGPUShadingLanguageRI/VariableDecl.js: Removed.
+        * WebGPUShadingLanguageRI/VariableRef.js: Removed.
+        * WebGPUShadingLanguageRI/VectorType.js: Removed.
+        * WebGPUShadingLanguageRI/VisitingSet.js: Removed.
+        * WebGPUShadingLanguageRI/Visitor.js: Removed.
+        * WebGPUShadingLanguageRI/WLexicalError.js: Removed.
+        * WebGPUShadingLanguageRI/WSyntaxError.js: Removed.
+        * WebGPUShadingLanguageRI/WTrapError.js: Removed.
+        * WebGPUShadingLanguageRI/WTypeError.js: Removed.
+        * WebGPUShadingLanguageRI/WhileLoop.js: Removed.
+        * WebGPUShadingLanguageRI/WrapChecker.js: Removed.
+        * WebGPUShadingLanguageRI/index.html: Removed.
+        * WebGPUShadingLanguageRI/spirv.core.grammar.json: Removed.
+        * WebGPUShadingLanguageRI/wsl-tests.yaml: Removed.
+
 2018-10-15  Philippe Normand  <pnormand@igalia.com>
 
         [GTK] Disable MSE build support on Debian and Ubuntu LTS bots
diff --git a/Tools/WebGPUShadingLanguageRI/AddressSpace.js b/Tools/WebGPUShadingLanguageRI/AddressSpace.js
deleted file mode 100644 (file)
index d3ed26d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-const addressSpaces = ["constant", "device", "threadgroup", "thread"];
-
-function isAddressSpace(addressSpace)
-{
-    switch (addressSpace) {
-    case "constant":
-    case "device":
-    case "threadgroup":
-    case "thread":
-        return true;
-    default:
-        return false;
-    }
-}
-
-function validateAddressSpace(addressSpace)
-{
-    if (!isAddressSpace(addressSpace))
-        throw new Error("Bad address space: " + addressSpace);
-}
diff --git a/Tools/WebGPUShadingLanguageRI/All.js b/Tools/WebGPUShadingLanguageRI/All.js
deleted file mode 100644 (file)
index ba65cc5..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-load("Node.js");
-load("Type.js");
-load("ReferenceType.js");
-load("Value.js");
-load("Expression.js");
-load("Rewriter.js");
-load("Visitor.js");
-load("CreateLiteral.js");
-load("CreateLiteralType.js");
-load("PropertyAccessExpression.js");
-load("NativeType.js");
-load("Semantic.js");
-
-load("AddressSpace.js");
-load("AllocateAtEntryPoints.js");
-load("AnonymousVariable.js");
-load("ArrayRefType.js");
-load("ArrayType.js");
-load("Assignment.js");
-load("AutoWrapper.js");
-load("Block.js");
-load("BoolLiteral.js");
-load("Break.js");
-load("BuiltInSemantic.js");
-load("BuiltinMatrixGetter.js");
-load("BuiltinMatrixSetter.js");
-load("BuiltinVectorGetter.js");
-load("BuiltinVectorSetter.js");
-load("CallExpression.js");
-load("CallFunction.js");
-load("Casts.js");
-load("Check.js");
-load("CheckLiteralTypes.js");
-load("CheckLoops.js");
-load("CheckNativeFuncStages.js");
-load("CheckRecursion.js");
-load("CheckRecursiveTypes.js");
-load("CheckReturns.js");
-load("CheckTypesWithArguments.js");
-load("CheckUnreachableCode.js");
-load("CheckWrapped.js");
-load("Checker.js");
-load("CloneProgram.js");
-load("CommaExpression.js");
-load("ConstexprFolder.js");
-load("Continue.js");
-load("ConvertPtrToArrayRefExpression.js");
-load("DoWhileLoop.js");
-load("DotExpression.js");
-load("DereferenceExpression.js");
-load("EArrayRef.js");
-load("EBuffer.js");
-load("EBufferBuilder.js");
-load("EPtr.js");
-load("EnumLiteral.js");
-load("EnumMember.js");
-load("EnumType.js");
-load("EvaluationCommon.js");
-load("Evaluator.js");
-load("ExpressionFinder.js");
-load("ExternalOrigin.js");
-load("Field.js");
-load("FindHighZombies.js");
-load("FlattenedStructOffsetGatherer.js");
-load("FloatLiteral.js");
-load("FloatLiteralType.js");
-load("FoldConstexprs.js");
-load("ForLoop.js");
-load("Func.js");
-load("FuncAttribute.js");
-load("FuncDef.js");
-load("FuncNumThreadsAttribute.js");
-load("FuncParameter.js");
-load("FunctionLikeBlock.js");
-load("HighZombieFinder.js");
-load("IdentityExpression.js");
-load("IfStatement.js");
-load("IndexExpression.js");
-load("InferTypesForCall.js");
-load("Inline.js");
-load("Inliner.js");
-load("IntLiteral.js");
-load("IntLiteralType.js");
-load("Intrinsics.js");
-load("LayoutBuffers.js");
-load("Lexer.js");
-load("LexerToken.js");
-load("LiteralTypeChecker.js");
-load("LogicalExpression.js");
-load("LogicalNot.js");
-load("LoopChecker.js");
-load("MakeArrayRefExpression.js");
-load("MakePtrExpression.js");
-load("MatrixType.js");
-load("NameContext.js");
-load("NameFinder.js");
-load("NameResolver.js");
-load("NativeFunc.js");
-load("NormalUsePropertyResolver.js");
-load("NullLiteral.js");
-load("NullType.js");
-load("OperatorAnderIndexer.js");
-load("OperatorArrayRefLength.js");
-load("OriginKind.js");
-load("OverloadResolutionFailure.js");
-load("Parse.js");
-load("Prepare.js");
-load("PropertyResolver.js");
-load("Program.js");
-load("ProgramWithUnnecessaryThingsRemoved.js");
-load("PtrType.js");
-load("ReadModifyWriteExpression.js");
-load("RecursionChecker.js");
-load("RecursiveTypeChecker.js");
-load("ResolveNames.js");
-load("ResolveOverloadImpl.js");
-load("ResolveProperties.js");
-load("ResolveTypeDefs.js");
-load("ResourceSemantic.js");
-load("Return.js");
-load("ReturnChecker.js");
-load("ReturnException.js");
-load("Sampler.js");
-load("SpecializationConstantSemantic.js");
-load("StageInOutSemantic.js");
-load("StandardLibrary.js");
-load("StatementCloner.js");
-load("StructLayoutBuilder.js");
-load("StructType.js");
-load("SwitchCase.js");
-load("SwitchStatement.js");
-load("SynthesizeArrayOperatorLength.js");
-load("SynthesizeEnumFunctions.js");
-load("SynthesizeStructAccessors.js");
-load("SynthesizeCopyConstructorOperator.js");
-load("SynthesizeDefaultConstructorOperator.js");
-load("TernaryExpression.js");
-load("Texture.js");
-load("TextureOperations.js");
-load("TrapStatement.js");
-load("TypeDef.js");
-load("TypeDefResolver.js");
-load("TypeRef.js");
-load("TypeOverloadResolutionFailure.js");
-load("TypedValue.js");
-load("UintLiteral.js");
-load("UintLiteralType.js");
-load("UnificationContext.js");
-load("UnreachableCodeChecker.js");
-load("VariableDecl.js");
-load("VariableRef.js");
-load("VectorType.js");
-load("VisitingSet.js");
-load("WLexicalError.js");
-load("WSyntaxError.js");
-load("WTrapError.js");
-load("WTypeError.js");
-load("WhileLoop.js");
-load("WrapChecker.js");
diff --git a/Tools/WebGPUShadingLanguageRI/AllocateAtEntryPoints.js b/Tools/WebGPUShadingLanguageRI/AllocateAtEntryPoints.js
deleted file mode 100644 (file)
index 2cde53f..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
-
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-function gatherEntryPoints(program)
-{
-    const entryPoints = new Set();
-    for (let [name, funcDefs] of program.functions) {
-        for (let funcDef of funcDefs) {
-            if (funcDef.isEntryPoint)
-                entryPoints.add(funcDef);
-        }
-    }
-    return entryPoints;
-}
-
-function gatherCallees(funcDefs)
-{
-    const calleeSet = new Set();
-    class FindFunctionsThatAreCalled extends Visitor
-    {
-        visitCallExpression(node)
-        {
-            super.visitCallExpression(node);
-            if (node.func instanceof FuncDef && !calleeSet.has(node.func)) {
-                calleeSet.add(node.func);
-                node.func.visit(this);
-            }
-        }
-    }
-    const visitor = new FindFunctionsThatAreCalled();
-    for (let funcDef of funcDefs)
-        funcDef.visit(visitor);
-    return calleeSet;
-}
-
-function gatherVariablesAndFunctionParameters(funcDefs)
-{
-    const varsAndParams = new Set();
-    class VarAndParamVisitor extends Visitor {
-
-        constructor(isEntryPoint)
-        {
-            super();
-            this._isEntryPoint = isEntryPoint;
-        }
-
-        visitFuncParameter(node)
-        {
-            if (!this._isEntryPoint)
-                varsAndParams.add(node);
-        }
-
-        visitVariableDecl(node)
-        {
-            varsAndParams.add(node);
-        }
-    }
-    for (let func of funcDefs)
-        func.visit(new VarAndParamVisitor(func.isEntryPoint));
-    return varsAndParams;
-}
-
-function createGlobalStructTypeAndVarToFieldMap(origin, allVariablesAndFunctionParameters, functionsThatAreCalledByEntryPoints)
-{
-    const globalStructType = new StructType(origin, null);
-    let counter = 0;
-    const varToFieldMap = new Map();
-
-    for (let varOrParam of allVariablesAndFunctionParameters) {
-        const fieldName = `field${counter++}_${varOrParam.name}`;
-        globalStructType.add(new Field(varOrParam.origin, fieldName, varOrParam.type));
-        varToFieldMap.set(varOrParam, fieldName);
-    }
-
-    for (let func of functionsThatAreCalledByEntryPoints) {
-        if (func.returnType.name !== "void") {
-            const fieldName = `field${counter++}_return_${func.name}`;
-            globalStructType.add(new Field(func.origin, fieldName, func.returnType));
-            func.returnFieldName = fieldName;
-        }
-    }
-
-    return [ globalStructType, varToFieldMap ];
-}
-
-function allocateAtEntryPoints(program)
-{
-    const entryPoints = gatherEntryPoints(program);
-    const allCallees = gatherCallees(entryPoints);
-    const allExecutedFunctions = new Set([...entryPoints, ...allCallees]);
-    const allVariablesAndFunctionParameters = gatherVariablesAndFunctionParameters(allExecutedFunctions);
-
-    if (!allVariablesAndFunctionParameters.size)
-        return;
-
-    const anyEntryPoint = entryPoints.values().next().value;
-    const [ globalStructType, varToFieldMap ] = createGlobalStructTypeAndVarToFieldMap(anyEntryPoint.origin, allVariablesAndFunctionParameters, allCallees);
-    program.add(globalStructType);
-    // All other struct accessors will have been synthesized at this point (they have to be synthesized earlier for call resolution).
-    synthesizeStructAccessorsForStructType(program, globalStructType);
-
-    const globalStructTypeRef = TypeRef.wrap(globalStructType);
-    const ptrToGlobalStructType = new PtrType(anyEntryPoint.origin, "thread", globalStructTypeRef);
-    const ptrToGlobalStructTypeRef = TypeRef.wrap(ptrToGlobalStructType);
-
-    const funcNewParameterMapping = new Map();
-    function updateFunction(func)
-    {
-        class UpdateFunctions extends Rewriter {
-            constructor()
-            {
-                super();
-                if (func.isEntryPoint)
-                    this._addVariableDeclaration();
-                else
-                    this._reconfigureParameters();
-                func.body = func._body.visit(this);
-            }
-
-            _addVariableDeclaration()
-            {
-                this._variableDecl = new VariableDecl(func.origin, "global struct", globalStructTypeRef, null);
-                this.makeGlobalStructVariableRef = () => new MakePtrExpression(func.origin, VariableRef.wrap(this._variableDecl));
-                func.body.statements.unshift(this._variableDecl);
-            }
-
-            _reconfigureParameters()
-            {
-                const funcParam = new FuncParameter(func.origin, null, ptrToGlobalStructTypeRef);
-                this.makeGlobalStructVariableRef = () =>  VariableRef.wrap(funcParam);
-                funcNewParameterMapping.set(func, [ funcParam ]);
-            }
-
-            _callExpressionForFieldName(node, fieldName)
-            {
-                if (!fieldName)
-                    throw new Error("Field name was null");
-                const functionName = `operator&.${fieldName}`;
-                const possibleAndOverloads = program.globalNameContext.get(Func, functionName);
-                const callExpressionResolution = CallExpression.resolve(node.origin, possibleAndOverloads, functionName, [ this.makeGlobalStructVariableRef() ], [ ptrToGlobalStructTypeRef ]);
-                return callExpressionResolution.call;
-            }
-
-            _dereferencedCallExpressionForFieldName(node, resultType, fieldName)
-            {
-                const derefExpr = new DereferenceExpression(node.origin, this._callExpressionForFieldName(node, fieldName), node.type, "thread");
-                derefExpr.type = resultType;
-                return derefExpr;
-            }
-
-            visitVariableRef(node)
-            {
-                if (!varToFieldMap.has(node.variable))
-                    return super.visitVariableRef(node);
-                return this._dereferencedCallExpressionForFieldName(node, node.variable.type, varToFieldMap.get(node.variable));
-            }
-
-            visitVariableDecl(node)
-            {
-                if (node == this._variableDecl)
-                    return node;
-                else if (node.initializer) {
-                    if (!node.type)
-                        throw new Error(`${node} doesn't have a type`);
-                    return new Assignment(node.origin, this._dereferencedCallExpressionForFieldName(node, node.type, varToFieldMap.get(node)), node.initializer.visit(this), node.type);
-                }
-                return new Block(node.origin);
-            }
-
-            visitCallExpression(node)
-            {
-                node = super.visitCallExpression(node);
-                if (node.func instanceof FuncDef) {
-                    let exprs = [];
-                    const anonymousVariableAssignments = [];
-                    for (let i = node.argumentList.length; i--;) {
-                        const type = node.func.parameters[i].type;
-                        if (!type)
-                            throw new Error(`${node.func.parameters[i]} has no type`);
-                        const anonymousVariable = new AnonymousVariable(node.origin, type);
-                        exprs.push(anonymousVariable);
-                        exprs.push(new Assignment(node.origin, VariableRef.wrap(anonymousVariable), node.argumentList[i], type));
-                        anonymousVariableAssignments.push(new Assignment(node.origin, this._dereferencedCallExpressionForFieldName(node.func.parameters[i], node.func.parameters[i].type, varToFieldMap.get(node.func.parameters[i])), VariableRef.wrap(anonymousVariable), type));
-                    }
-                    exprs = exprs.concat(anonymousVariableAssignments);
-                    exprs.push(node);
-
-                    if (node.func.returnType.name !== "void")
-                        exprs.push(this._dereferencedCallExpressionForFieldName(node.func, node.func.returnType, node.func.returnFieldName));
-
-                    node.argumentList = [ this.makeGlobalStructVariableRef() ];
-                    return new CommaExpression(node.origin, exprs);
-                }
-
-                return node;
-            }
-
-            visitReturn(node)
-            {
-                node = super.visitReturn(node);
-                if (!func.isEntryPoint && node.value) {
-                    return new CommaExpression(node.origin, [
-                        new Assignment(node.origin, this._dereferencedCallExpressionForFieldName(func, func.returnType, func.returnFieldName), node.value, func.returnType),
-                        new Return(node.origin) ]);
-                } else
-                    return node;
-            }
-        }
-        func.visit(new UpdateFunctions());
-    }
-
-    for (let funcDef of allExecutedFunctions)
-        updateFunction(funcDef);
-
-    for (let [func, newParameters] of funcNewParameterMapping)
-        func.parameters = newParameters;
-
-    for (let func of allCallees)
-        func._returnType = TypeRef.wrap(program.types.get("void"));
-
-    class UpdateCallExpressionReturnTypes extends Visitor {
-        visitCallExpression(node)
-        {
-            super.visitCallExpression(node);
-            if (node.func instanceof FuncDef)
-                node._returnType = node.resultType = TypeRef.wrap(program.types.get("void"));
-        }
-    }
-    const updateCallExpressionVisitor = new UpdateCallExpressionReturnTypes();
-    for (let func of allExecutedFunctions)
-        func.visit(updateCallExpressionVisitor);
-}
diff --git a/Tools/WebGPUShadingLanguageRI/AnonymousVariable.js b/Tools/WebGPUShadingLanguageRI/AnonymousVariable.js
deleted file mode 100644 (file)
index 40f5bd3..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-let anonymousVariableCount = 0;
-
-class AnonymousVariable extends Value {
-    // You have to initialize the variable's value before use, but that could be quite late.
-    constructor(origin, type = null)
-    {
-        super();
-        this._origin = origin;
-        this.index = anonymousVariableCount++;
-        this.type = type;
-    }
-    
-    get origin() { return this._origin; }
-    get name() { return "anonVar<" + this.index + ">"; }
-    
-    toString()
-    {
-        return this.name;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/ArrayRefType.js b/Tools/WebGPUShadingLanguageRI/ArrayRefType.js
deleted file mode 100644 (file)
index b1403e8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-// Note that we say that T[] is "the same type" as T[c] for any T, c. This greatly simplifies the
-// language.
-class ArrayRefType extends ReferenceType {
-    unifyImpl(unificationContext, other)
-    {
-        if (!other.isArrayRef)
-            return false;
-        
-        if (this.addressSpace != other.addressSpace)
-            return false;
-        
-        return this.elementType.unify(unificationContext, other.elementType);
-    }
-    
-    get isArrayRef() { return true; }
-
-    argumentForAndOverload(origin, value)
-    {
-        return value;
-    }
-    argumentTypeForAndOverload(origin)
-    {
-        return this;
-    }
-
-    toString()
-    {
-        return this.elementType + "[] " + this.addressSpace;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/ArrayType.js b/Tools/WebGPUShadingLanguageRI/ArrayType.js
deleted file mode 100644 (file)
index b9d918e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class ArrayType extends Type {
-    constructor(origin, elementType, numElements)
-    {
-        if (!numElements)
-            throw new Error("null numElements");
-        super();
-        this._origin = origin;
-        this._elementType = elementType;
-        this._numElements = numElements;
-    }
-    
-    get origin() { return this._origin; }
-    get elementType() { return this._elementType; }
-    get numElements() { return this._numElements; }
-    get isPrimitive() { return this.elementType.isPrimitive; }
-    get isArray() { return true; }
-    
-    get numElementsValue()
-    {
-        if (!(this.numElements.isLiteral))
-            throw new Error("numElements is not a literal: " + this.numElements);
-        return this.numElements.value;
-    }
-
-    get arrayRefType()
-    {
-        return new ArrayRefType(this.origin, "thread", this.elementType);
-    }
-
-    toString()
-    {
-        return this.elementType + "[" + this.numElements + "]";
-    }
-    
-    get size()
-    {
-        return this.elementType.size * this.numElementsValue;
-    }
-    
-    populateDefaultValue(buffer, offset)
-    {
-        for (let i = 0; i < this.numElementsValue; ++i)
-            this.elementType.populateDefaultValue(buffer, offset + i * this.elementType.size);
-    }
-    
-    unifyImpl(unificationContext, other)
-    {
-        if (!(other instanceof ArrayType))
-            return false;
-        
-        if (!this.numElements.unify(unificationContext, other.numElements))
-            return false;
-        
-        return this.elementType.unify(unificationContext, other.elementType);
-    }
-
-    argumentForAndOverload(origin, value)
-    {
-        let result = new MakeArrayRefExpression(origin, value);
-        result.numElements = this.numElements;
-        return result;
-    }
-    argumentTypeForAndOverload(origin)
-    {
-        return new ArrayRefType(origin, "thread", this.elementType);
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/Assignment.js b/Tools/WebGPUShadingLanguageRI/Assignment.js
deleted file mode 100644 (file)
index 8184b15..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Assignment extends Expression {
-    constructor(origin, lhs, rhs, type = null)
-    {
-        super(origin);
-        this._lhs = lhs;
-        this._rhs = rhs;
-        this.type = type;
-    }
-    
-    get lhs() { return this._lhs; }
-    get rhs() { return this._rhs; }
-    
-    toString()
-    {
-        return this.lhs + " = " + this.rhs;
-    }
-};
-
diff --git a/Tools/WebGPUShadingLanguageRI/AutoWrapper.js b/Tools/WebGPUShadingLanguageRI/AutoWrapper.js
deleted file mode 100644 (file)
index ad196b7..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class AutoWrapper extends Rewriter {
-    visitVariableRef(node)
-    {
-        return node;
-    }
-    
-    visitTypeRef(node)
-    {
-        return node;
-    }
-    
-    visitFuncParameter(node)
-    {
-        return VariableRef.wrap(node);
-    }
-    
-    visitVariableDecl(node)
-    {
-        return VariableRef.wrap(node);
-    }
-    
-    visitStructType(node)
-    {
-        return TypeRef.wrap(node);
-    }
-    
-    visitNativeType(node)
-    {
-        return TypeRef.wrap(node);
-    }
-    
-    visitTypeVariable(node)
-    {
-        return TypeRef.wrap(node);
-    }
-    
-    visitGenericLiteralType(node)
-    {
-        return node;
-    }
-
-    visitNullType(node)
-    {
-        return node;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/Block.js b/Tools/WebGPUShadingLanguageRI/Block.js
deleted file mode 100644 (file)
index 664769f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Block extends Node {
-    constructor(origin)
-    {
-        super();
-        this._origin = origin;
-        this._statements = [];
-    }
-    
-    get origin() { return this._origin; }
-    
-    add(statement)
-    {
-        this._statements.push(statement);
-    }
-    
-    get statements() { return this._statements; }
-    
-    toString()
-    {
-        if (!this.statements.length)
-            return "{ }";
-        return "{ " + this.statements.join("; ") + "; }";
-    }
-};
-
diff --git a/Tools/WebGPUShadingLanguageRI/BoolLiteral.js b/Tools/WebGPUShadingLanguageRI/BoolLiteral.js
deleted file mode 100644 (file)
index 791ad98..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class BoolLiteral extends Expression {
-    constructor(origin, value)
-    {
-        super(origin);
-        this._value = value;
-    }
-    
-    get value() { return this._value; }
-    get isConstexpr() { return true; }
-    
-    toString()
-    {
-        return "" + this._value;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/Break.js b/Tools/WebGPUShadingLanguageRI/Break.js
deleted file mode 100644 (file)
index e972623..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Break extends Node {
-    constructor(origin)
-    {
-        super();
-        this._origin = origin;
-    }
-    
-    get origin() { return this._origin; }
-    
-    toString()
-    {
-        return "break";
-    }
-};
-
diff --git a/Tools/WebGPUShadingLanguageRI/BuiltInSemantic.js b/Tools/WebGPUShadingLanguageRI/BuiltInSemantic.js
deleted file mode 100644 (file)
index 2539332..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class BuiltInSemantic extends Semantic {
-    constructor(origin, name, ...extraArguments)
-    {
-        super(origin);
-        this._name = name;
-        this._extraArguments = extraArguments;
-    }
-
-    get name() { return this._name; }
-    get extraArguments() { return this._extraArguments; }
-
-    isAcceptableType(type, program)
-    {
-        let requiredType;
-        switch (this.name) {
-        case "SV_InstanceID":
-            requiredType = program.intrinsics.uint;
-            break;
-        case "SV_VertexID":
-            requiredType = program.intrinsics.uint;
-            break;
-        case "PSIZE":
-            requiredType = program.intrinsics.float;
-            break;
-        case "SV_Position":
-            requiredType = program.intrinsics["vector<float, 4>"];
-            break;
-        case "SV_IsFrontFace":
-            requiredType = program.intrinsics.bool;
-            break;
-        case "SV_SampleIndex":
-            requiredType = program.intrinsics.uint;
-            break;
-        case "SV_InnerCoverage":
-            requiredType = program.intrinsics.uint;
-            break;
-        case "SV_Target":
-            requiredType = program.intrinsics["vector<float, 4>"];
-            break;
-        case "SV_Depth":
-            requiredType = program.intrinsics.float;
-            break;
-        case "SV_Coverage":
-            requiredType = program.intrinsics.uint;
-            break;
-        case "SV_DispatchThreadID":
-            requiredType = program.intrinsics["vector<uint, 3>"];
-            break;
-        case "SV_GroupID":
-            requiredType = program.intrinsics["vector<uint, 3>"];
-            break;
-        case "SV_GroupIndex":
-            requiredType = program.intrinsics.uint;
-            break;
-        case "SV_GroupThreadID":
-            requiredType = program.intrinsics["vector<uint, 3>"];
-            break;
-        default:
-            throw new Error(`Unknown semantic: ${this.name}`);
-        }
-
-        return type.equals(requiredType);
-    }
-
-    isAcceptableForShaderType(direction, shaderType)
-    {
-        switch (shaderType) {
-        case "vertex":
-            switch (direction) {
-            case "input":
-                switch (this.name) {
-                case "SV_InstanceID":
-                case "SV_VertexID":
-                    return true;
-                default:
-                    return false;
-                }
-            case "output":
-                switch (this.name) {
-                case "PSIZE":
-                case "SV_Position":
-                    return true;
-                default:
-                    return false;
-                }
-            }
-        case "fragment":
-            switch (direction) {
-            case "input":
-                switch (this.name) {
-                case "SV_IsFrontFace":
-                case "SV_SampleIndex":
-                case "SV_InnerCoverage":
-                    return true;
-                default:
-                    return false;
-                }
-            case "output":
-                switch (this.name) {
-                case "SV_Target":
-                case "SV_Depth":
-                case "SV_Coverage":
-                    return true;
-                default:
-                    return false;
-                }
-            }
-        case "compute":
-            if (direction != "input")
-                return false;
-            switch (this.name) {
-            case "SV_DispatchThreadID":
-            case "SV_GroupID":
-            case "SV_GroupIndex":
-            case "SV_GroupThreadID":
-                return true;
-            default:
-                return false;
-            }
-        case "test":
-            return true;
-        default:
-            throw new Error(`Unknown shade type: ${shaderType}`);
-        }
-    }
-
-    toString()
-    {
-        let result = this.name;
-        if (this.extraArguments)
-            result += this.extraArguments.join("");
-        return result;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/BuiltinMatrixGetter.js b/Tools/WebGPUShadingLanguageRI/BuiltinMatrixGetter.js
deleted file mode 100644 (file)
index b339cf9..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class BuiltinMatrixGetter {
-    constructor(baseTypeName, height, width)
-    {
-        this._baseTypeName = baseTypeName;
-        this._height = height;
-        this._width = width;
-    }
-
-    get baseTypeName() { return this._baseTypeName; }
-    get height() { return this._height; }
-    get width() { return this._width; }
-
-    toString()
-    {
-        return `native ${this.baseTypeName}${this.width} operator[](${this.baseTypeName}${this.height}x${this.width},uint)`;
-    }
-
-    static functions()
-    {
-        if (!this._functions) {
-            this._functions = [];
-
-            for (let typeName of ["half", "float"]) {
-                for (let height of [2, 3, 4]) {
-                    for (let width of [2, 3, 4])
-                        this._functions.push(new BuiltinMatrixGetter(typeName, height, width));
-                }
-            }
-        }
-        return this._functions;
-    }
-
-    instantiateImplementation(func)
-    {
-        func.implementation = ([mat, index]) => {
-            const indexValue = index.loadValue();
-            if (indexValue >= 0 && indexValue < this.height) {
-                const result = new EPtr(new EBuffer(this.width), 0);
-                for (let i = 0; i < this.width; i++)
-                    result.set(i, mat.get(indexValue * this.width + i));
-                return result;
-            } else
-                throw new WTrapError("[Builtin matrix getter]", "Out-of-bounds index when indexing into a matrix");
-        };
-        func.implementationData = this;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/BuiltinMatrixSetter.js b/Tools/WebGPUShadingLanguageRI/BuiltinMatrixSetter.js
deleted file mode 100644 (file)
index f7b8574..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class BuiltinMatrixSetter {
-    constructor(baseTypeName, height, width)
-    {
-        this._baseTypeName = baseTypeName;
-        this._height = height;
-        this._width = width;
-    }
-
-    get baseTypeName() { return this._baseTypeName; }
-    get height() { return this._height; }
-    get width() { return this._width; }
-
-    toString()
-    {
-        return `native ${this.baseTypeName}${this.height}x${this.width} operator[]=(${this.baseTypeName}${this.height}x${this.width},uint,${this.baseTypeName}${this.width})`;
-    }
-
-    static functions()
-    {
-        if (!this._functions) {
-            this._functions = [];
-
-            for (let typeName of ["half", "float"]) {
-                for (let height of [2, 3, 4]) {
-                    for (let width of [2, 3, 4])
-                        this._functions.push(new BuiltinMatrixSetter(typeName, height, width));
-                }
-            }
-        }
-        return this._functions;
-    }
-
-    instantiateImplementation(func)
-    {
-        func.implementation = ([base, index, value]) => {
-            const indexValue = index.loadValue();
-            if (indexValue >= 0 && indexValue < this.height) {
-                let result = new EPtr(new EBuffer(this.width * this.height), 0);
-                result.copyFrom(base, this.width * this.height);
-                result.plus(indexValue * this.width).copyFrom(value, this.width);
-                return result;
-            } else
-                throw new WTrapError("[Builtin matrix setter]", "Out-of-bounds index when indexing into a matrix");
-        };
-        func.implementationData = this;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/BuiltinVectorGetter.js b/Tools/WebGPUShadingLanguageRI/BuiltinVectorGetter.js
deleted file mode 100644 (file)
index 40872b4..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class BuiltinVectorGetter {
-    constructor(baseTypeName, size, elementName, index)
-    {
-        this._baseTypeName = baseTypeName;
-        this._size = size;
-        this._elementName = elementName;
-        this._index = index;
-    }
-
-    get baseTypeName() { return this._baseTypeName; }
-    get size() { return this._size; }
-    get elementName() { return this._elementName; }
-    get index() { return this._index; }
-
-    toString()
-    {
-        return `native ${this.baseTypeName} operator.${this.elementName}(${this.baseTypeName}${this.size})`;
-    }
-
-    static functions()
-    {
-        if (!this._functions) {
-            this._functions = [];
-
-            const elements = [ "x", "y", "z", "w" ];
-
-            for (let typeName of VectorElementTypes) {
-                for (let size of VectorElementSizes) {
-                    for (let i = 0; i < size; i++)
-                        this._functions.push(new BuiltinVectorGetter(typeName, size, elements[i], i));
-                }
-            }
-        }
-        return this._functions;
-    }
-
-    instantiateImplementation(func)
-    {
-        func.implementation = ([vec]) => {
-            return EPtr.box(vec.get(this.index));
-        };
-        func.implementationData = this;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/BuiltinVectorSetter.js b/Tools/WebGPUShadingLanguageRI/BuiltinVectorSetter.js
deleted file mode 100644 (file)
index d559591..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class BuiltinVectorSetter {
-    constructor(baseTypeName, size, elementName, index)
-    {
-        this._baseTypeName = baseTypeName;
-        this._size = size;
-        this._elementName = elementName;
-        this._index = index;
-    }
-
-    get baseTypeName() { return this._baseTypeName; }
-    get size() { return this._size; }
-    get elementName() { return this._elementName; }
-    get index() { return this._index; }
-
-    toString()
-    {
-        return `native ${this.baseTypeName}${this.size} operator.${this.elementName}=(${this.baseTypeName}${this.size},${this.baseTypeName})`;
-    }
-
-    static functions()
-    {
-        if (!this._functions) {
-            this._functions = [];
-
-            const elements = [ "x", "y", "z", "w" ];
-
-            for (let typeName of VectorElementTypes) {
-                for (let size of VectorElementSizes) {
-                    for (let i = 0; i < size; i++)
-                        this._functions.push(new BuiltinVectorSetter(typeName, size, elements[i], i));
-                }
-            }
-        }
-        return this._functions;
-    }
-
-    instantiateImplementation(func)
-    {
-        func.implementation = ([base, value]) => {
-            let result = new EPtr(new EBuffer(this.size), 0);
-            result.copyFrom(base, this.size);
-            result.plus(this.index).copyFrom(value, 1);
-            return result;
-        };
-        func.implementationData = this;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/CallExpression.js b/Tools/WebGPUShadingLanguageRI/CallExpression.js
deleted file mode 100644 (file)
index 04be2da..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class CallExpression extends Expression {
-    constructor(origin, name, argumentList)
-    {
-        super(origin);
-        this._name = name;
-        this._argumentList = argumentList;
-        this.func = null;
-        this._isCast = false;
-        this._returnType = null;
-    }
-    
-    get name() { return this._name; }
-
-    get argumentList() { return this._argumentList; }
-
-    set argumentList(newValue)
-    {
-        this._argumentList = newValue;
-    }
-
-    get isCast() { return this._isCast; }
-    get returnType() { return this._returnType; }
-    
-    static resolve(origin, possibleOverloads, name, argumentList, argumentTypes, returnType, program)
-    {
-        let call = new CallExpression(origin, name, argumentList);
-        call.argumentTypes = argumentTypes.map(argument => argument.visit(new AutoWrapper()));
-        call.possibleOverloads = possibleOverloads;
-        if (returnType)
-            call.setCastData(returnType);
-        return {call, resultType: call.resolve(possibleOverloads, program)};
-    }
-
-    resolve(possibleOverloads, program)
-    {
-        let failures = [];
-        let overload;
-        if (possibleOverloads)
-            overload = resolveOverloadImpl(possibleOverloads, this.argumentTypes, this.returnType);
-
-        if (!overload || !overload.func) {
-            if (!overload)
-                overload = {};
-            const func = this._resolveByInstantiation(program);
-            if (func)
-                overload.func = func;
-        }
-
-        if (!overload.func) {
-            if (!overload.failures)
-                overload.failures = [];
-            failures.push(...overload.failures);
-            let message = "Did not find function named " + this.name + " for call with ";
-            message += "argument types (" + this.argumentTypes + ")";
-            if (this.returnType)
-                message +=" and return type " + this.returnType;
-            if (failures.length)
-                message += ", but considered:\n" + failures.join("\n")
-            throw new WTypeError(this.origin.originString, message);
-        }
-
-        for (let i = 0; i < this.argumentTypes.length; ++i) {
-            let argumentType = this.argumentTypes[i];
-            let parameterType = overload.func.parameters[i].type;
-            let result = argumentType.equalsWithCommit(parameterType);
-            if (!result)
-                throw new Error("At " + this.origin.originString + " argument and parameter types not equal after type argument substitution: argument = " + argumentType + ", parameter = " + parameterType);
-        }
-        return this.resolveToOverload(overload);
-    }
-
-    _resolveByInstantiation(program)
-    {
-        let func;
-        if (this.name == "operator&[]")
-            func = this._resolveWithOperatorAnderIndexer(program);
-        else if (this.name == "operator.length")
-            func = this._resolveWithOperatorLength(program);
-        else if (this.name == "operator==" && this.argumentTypes.length == 2
-            && (this.argumentTypes[0] instanceof NullType || this.argumentTypes[0] instanceof ReferenceType)
-            && (this.argumentTypes[1] instanceof NullType || this.argumentTypes[1] instanceof ReferenceType)
-            && this.argumentTypes[0].equals(this.argumentTypes[1]))
-                func = this._resolveWithReferenceComparator(program);
-        else
-            return null;
-
-        program.add(func);
-        return func;
-    }
-
-    _resolveWithOperatorAnderIndexer(program)
-    {
-        let arrayRefType = this.argumentTypes[0];
-        if (!arrayRefType.isArrayRef)
-            throw new WTypeError(this.origin.originString, `Expected ${arrayRefType} to be an array ref type for operator&[]`);
-
-        let indexType = this.argumentTypes[1];
-        const addressSpace = arrayRefType.addressSpace;
-
-        // The later checkLiteralTypes stage will verify that the literal can be represented as a uint.
-        const uintType = TypeRef.wrap(program.intrinsics.uint);
-        indexType.type = uintType;
-
-        const elementType = this.argumentTypes[0].elementType;
-        this.resultType = TypeRef.wrap(new PtrType(this.origin, addressSpace, TypeRef.wrap(elementType)))
-
-        let arrayRefAccessor = new OperatorAnderIndexer(this.resultType.toString(), addressSpace);
-        const func = new NativeFunc(this.origin, "operator&[]", this.resultType, [
-            new FuncParameter(this.origin, null, arrayRefType),
-            new FuncParameter(this.origin, null, uintType)
-        ]);
-
-        arrayRefAccessor.instantiateImplementation(func);
-
-        return func;
-    }
-
-    _resolveWithOperatorLength(program)
-    {
-        this.resultType = TypeRef.wrap(program.intrinsics.uint);
-
-        if (this.argumentTypes[0].isArray) {
-            const arrayType = this.argumentTypes[0];
-            const func = new NativeFunc(this.origin, "operator.length", this.resultType, [
-                new FuncParameter(this.origin, null, arrayType)
-            ]);
-            func.implementation = (args) => EPtr.box(arrayType.numElementsValue);
-            return func;
-        } else if (this.argumentTypes[0].isArrayRef) {
-            const arrayRefType = this.argumentTypes[0];
-            const addressSpace = arrayRefType.addressSpace;
-            const operatorLength = new OperatorArrayRefLength(arrayRefType.toString(), addressSpace);
-            const func = new NativeFunc(this.origin, "operator.length", this.resultType, [
-                new FuncParameter(this.origin, null, arrayRefType)
-            ]);
-            operatorLength.instantiateImplementation(func);
-            return func;
-        } else
-            throw new WTypeError(this.origin.originString, `Expected ${this.argumentTypes[0]} to be array/array ref type for operator.length`);
-    }
-
-    _resolveWithReferenceComparator(program)
-    {
-        let argumentType = this.argumentTypes[0];
-        if (argumentType instanceof NullType)
-            argumentType = this.argumentTypes[1];
-        if (argumentType instanceof NullType) {
-            // We encountered "null == null".
-            // The type isn't observable, so we can pick whatever we want.
-            // FIXME: This can probably be generalized, using the "preferred type" infrastructure used by generic literals
-            argumentType = new PtrType(this.origin, "thread", program.intrinsics.int);
-        }
-        this.resultType = TypeRef.wrap(program.intrinsics.bool);
-        const func = new NativeFunc(this.origin, "operator==", this.resultType, [
-            new FuncParameter(this.origin, null, argumentType),
-            new FuncParameter(this.origin, null, argumentType)
-        ]);
-        func.implementation = ([lhs, rhs]) => {
-            let left = lhs.loadValue();
-            let right = rhs.loadValue();
-            if (left && right)
-                return EPtr.box(left.equals(right));
-            return EPtr.box(left == right);
-        };
-        return func;
-    }
-    
-    resolveToOverload(overload)
-    {
-        this.func = overload.func;
-        let result = overload.func.returnType;
-        if (!result)
-            throw new Error("Null return type");
-        result = result.visit(new AutoWrapper());
-        this.resultType = result;
-        return result;
-    }
-    
-    setCastData(returnType)
-    {
-        this._returnType = returnType;
-        this._isCast = true;
-    }
-    
-    toString()
-    {
-        return (this.isCast ? "operator " + this.returnType : this.name) +
-            "(" + this.argumentList + ")";
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CallFunction.js b/Tools/WebGPUShadingLanguageRI/CallFunction.js
deleted file mode 100644 (file)
index 72f674e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-// This allows you to pass structs and arrays in-place, but it's a more annoying API.
-function callFunction(program, name, argumentList)
-{
-    let argumentTypes = argumentList.map(argument => argument.type);
-    let overload = program.globalNameContext.resolveFuncOverload(name, argumentTypes, null, true);
-    if (!overload.func)
-        throw new WTypeError("<callFunction>", "Cannot resolve function call " + name + "(" + argumentList + ")" + (overload.failures.length ? "; tried:\n" + overload.failures.join("\n") : ""));
-
-    const func = overload.func;
-    for (let i = 0; i < func.parameters.length; ++i) {
-        let type = argumentTypes[i];
-        type.visit(new StructLayoutBuilder());
-        func.parameters[i].ePtr.copyFrom(argumentList[i].ePtr, type.size);
-    }
-    let result = new Evaluator(program).runFunc(func);
-    return new TypedValue(func.returnType, result);
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/Casts.js b/Tools/WebGPUShadingLanguageRI/Casts.js
deleted file mode 100644 (file)
index c8f08ce..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function cast(typedArrayConstructor, number)
-{
-    var array = new typedArrayConstructor(1);
-    array[0] = number;
-    return array[0];
-}
-
-function bitwiseCast(typedArrayConstructor1, typedArrayConstructor2, value)
-{
-    let typedArray1 = new typedArrayConstructor1(1);
-    let typedArray2 = new typedArrayConstructor2(typedArray1.buffer);
-    typedArray1[0] = value;
-    return typedArray2[0];
-}
-
-function castToBool(value)
-{
-    return !!value;
-}
-
-function castToUchar(number)
-{
-    return number & 0xFF;
-}
-
-function castToUshort(number)
-{
-    return number & 0xFFFF;
-}
-
-function castToUint(number)
-{
-    return number >>> 0;
-}
-
-function castToChar(number)
-{
-    return cast(Int8Array, number);
-}
-
-function castToShort(number)
-{
-    return cast(Int16Array, number);
-}
-
-function castToInt(number)
-{
-    return number | 0;
-}
-
-function castToHalf(number)
-{
-    // FIXME: Make this math obey IEEE 754.
-    if (Number.isNaN(number))
-       return number
-    if (number > 65504)
-        return Number.POSITIVE_INFINITY;
-    if (number < -65504)
-        return Number.NEGATIVE_INFINITY;
-    if (number > 0 && number < Math.pow(2, -24))
-        return 0;
-    if (number < 0 && number > -Math.pow(2, -24))
-        return -0;
-    let doubleArray = new Float64Array(1);
-    let uintArray = new Uint8Array(doubleArray.buffer);
-    doubleArray[0] = number;
-    let sign = uintArray[7] & 0x80;
-    let exponent = ((uintArray[7] & 0x7f) << 4) | ((uintArray[6] & 0xf0) >>> 4);
-    let significand = ((uintArray[6] & 0x0f) << 6) | ((uintArray[5] & 0xfc) >>> 2);
-
-    if ((exponent - 1023) < -14) {
-        exponent = 0;
-        significand = (Math.abs(number) * Math.pow(2, 24)) >>> 0;
-        let value = Math.pow(2, -14) * significand / 1024;
-        if (sign != 0)
-            value *= -1;
-        return value;
-    }
-
-    doubleArray[0] = 0;
-
-    uintArray[7] |= sign;
-    uintArray[7] |= (exponent >>> 4);
-    uintArray[6] |= ((exponent << 4) & 0xf0);
-    uintArray[6] |= (significand >>> 6);
-    uintArray[5] |= ((significand << 2) & 0xfc);
-
-    return doubleArray[0];
-}
-
-function castToFloat(number)
-{
-    return Math.fround(number);
-}
-
-function castAndCheckValue(castFunction, value)
-{
-    const castedValue = castFunction(value);
-    if (!isBitwiseEquivalent(castedValue, value))
-        throw new Error(`${value} was casted and yielded ${castedValue}, which is not bitwise equivalent.`);
-    return castedValue;
-}
-
-function isBitwiseEquivalent(left, right)
-{
-    let doubleArray = new Float64Array(1);
-    let intArray = new Int32Array(doubleArray.buffer);
-    doubleArray[0] = left;
-    let leftInts = Int32Array.from(intArray);
-    doubleArray[0] = right;
-    for (let i = 0; i < 2; ++i) {
-        if (leftInts[i] != intArray[i])
-            return false;
-    }
-    return true;
-}
diff --git a/Tools/WebGPUShadingLanguageRI/Check.js b/Tools/WebGPUShadingLanguageRI/Check.js
deleted file mode 100644 (file)
index 2409774..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function check(program)
-{
-    program.visit(new Checker(program));
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CheckLiteralTypes.js b/Tools/WebGPUShadingLanguageRI/CheckLiteralTypes.js
deleted file mode 100644 (file)
index b7d58ac..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkLiteralTypes(program)
-{
-    program.visit(new LiteralTypeChecker());
-}
diff --git a/Tools/WebGPUShadingLanguageRI/CheckLoops.js b/Tools/WebGPUShadingLanguageRI/CheckLoops.js
deleted file mode 100644 (file)
index cb362e9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkLoops(program)
-{
-    program.visit(new LoopChecker());
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CheckNativeFuncStages.js b/Tools/WebGPUShadingLanguageRI/CheckNativeFuncStages.js
deleted file mode 100644 (file)
index c3c047f..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-function checkNativeFuncStages(program)
-{
-    class CheckNativeFuncStages extends Visitor {
-        constructor(entryPoint) {
-            super();
-            this._entryPoint = entryPoint;
-        }
-
-        visitCallExpression(node)
-        {
-            if ((node.func instanceof NativeFunc) && node.func.stage && node.func.stage != this._entryPoint.shaderType)
-                throw new WTypeError(node.origin, `Cannot call ${node.func.stage} function ${node.func.name} inside ${this._entryPoint.shadeType} entry point`);
-            node.func.visit(this);
-        }
-    }
-    for (let [name, funcDefs] of program.functions) {
-        for (let funcDef of funcDefs) {
-            if (funcDef.isEntryPoint)
-                funcDef.visit(new CheckNativeFuncStages(funcDef));
-        }
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/CheckRecursion.js b/Tools/WebGPUShadingLanguageRI/CheckRecursion.js
deleted file mode 100644 (file)
index cc21158..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkRecursion(program)
-{
-    program.visit(new RecursionChecker(program));
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CheckRecursiveTypes.js b/Tools/WebGPUShadingLanguageRI/CheckRecursiveTypes.js
deleted file mode 100644 (file)
index 1e19dd0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkRecursiveTypes(program)
-{
-    program.visit(new RecursiveTypeChecker());
-}
diff --git a/Tools/WebGPUShadingLanguageRI/CheckReturns.js b/Tools/WebGPUShadingLanguageRI/CheckReturns.js
deleted file mode 100644 (file)
index 465fe36..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkReturns(program)
-{
-    program.visit(new ReturnChecker(program));
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CheckTypesWithArguments.js b/Tools/WebGPUShadingLanguageRI/CheckTypesWithArguments.js
deleted file mode 100644 (file)
index 2f69142..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkTypesWithArguments(program)
-{
-    class TypeWithArgumentsChecker extends Visitor {
-        visitTypeRef(node)
-        {
-            if ((node.name == "vector" && node.typeArguments.length != 2)
-                || (node.name == "matrix" && node.typeArguments.length != 3)
-                || (node.name == "Texture1D" && node.typeArguments.length != 1)
-                || (node.name == "RWTexture1D" && node.typeArguments.length != 1)
-                || (node.name == "Texture1DArray" && node.typeArguments.length != 1)
-                || (node.name == "RWTexture1DArray" && node.typeArguments.length != 1)
-                || (node.name == "Texture2D" && node.typeArguments.length != 1)
-                || (node.name == "RWTexture2D" && node.typeArguments.length != 1)
-                || (node.name == "Texture2DArray" && node.typeArguments.length != 1)
-                || (node.name == "RWTexture2DArray" && node.typeArguments.length != 1)
-                || (node.name == "Texture3D" && node.typeArguments.length != 1)
-                || (node.name == "RWTexture3D" && node.typeArguments.length != 1)
-                || (node.name == "TextureCube" && node.typeArguments.length != 1))
-                throw new Error(`Builtin type ${node.name} should always have type arguments.`);
-        }
-    }
-    program.visit(new TypeWithArgumentsChecker());
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CheckUnreachableCode.js b/Tools/WebGPUShadingLanguageRI/CheckUnreachableCode.js
deleted file mode 100644 (file)
index df31da9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkUnreachableCode(program)
-{
-    program.visit(new UnreachableCodeChecker(program));
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CheckWrapped.js b/Tools/WebGPUShadingLanguageRI/CheckWrapped.js
deleted file mode 100644 (file)
index e203ac1..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function checkExpressionWrapped(node)
-{
-    node.visit(new WrapChecker(node));
-}
-
-function checkProgramWrapped(node)
-{
-    node.visit(new ExpressionFinder(checkExpressionWrapped));
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/Checker.js b/Tools/WebGPUShadingLanguageRI/Checker.js
deleted file mode 100644 (file)
index 518ffe6..0000000
+++ /dev/null
@@ -1,918 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Checker extends Visitor {
-    constructor(program)
-    {
-        super();
-        this._program = program;
-        this._currentStatement = null;
-        this._vertexEntryPoints = new Set();
-        this._fragmentEntryPoints = new Set();
-        this._computeEntryPoints = new Set();
-    }
-
-    visitProgram(node)
-    {
-        let doStatement = statement => {
-            this._currentStatement = statement;
-            statement.visit(this);
-        }
-
-        for (let type of node.types.values()) {
-            if (type instanceof Array) {
-                for (let constituentType of type)
-                    doStatement(constituentType);
-            } else
-                doStatement(type);
-        }
-        for (let funcs of node.functions.values()) {
-            for (let func of funcs) {
-                this.visitFunc(func);
-            }
-        }
-        for (let funcs of node.functions.values()) {
-            for (let func of funcs)
-                doStatement(func);
-        }
-    }
-
-    _checkSemantics(node)
-    {
-        class Item {
-            constructor(type, semantic)
-            {
-                if (node.shaderType != "test" && !semantic)
-                    throw new WTypeError(node.origin.originString, "An entry-point input/output exists which doesn't have a semantic");
-                this._type = type;
-                this._semantic = semantic;
-            }
-
-            get type() { return this._type; }
-            get semantic() { return this._semantic; }
-        }
-
-        let program = this._program;
-        class Gatherer extends Visitor {
-            constructor(currentSemantic = null)
-            {
-                super();
-                this._currentSemantic = currentSemantic;
-                this._result = [];
-            }
-
-            reset(currentSemantic = null)
-            {
-                this.currentSemantic = currentSemantic;
-            }
-
-            set currentSemantic(value) { this._currentSemantic = value; }
-            get currentSemantic() { return this._currentSemantic; }
-            get result() { return this._result; }
-
-            visitEnumType(node)
-            {
-                this.result.push(new Item(node, this.currentSemantic));
-            }
-
-            visitVectorType(node)
-            {
-                this.result.push(new Item(node, this.currentSemantic));
-            }
-
-            visitMatrixType(node)
-            {
-                this.result.push(new Item(node, this.currentSemantic));
-            }
-
-            visitNativeType(node)
-            {
-                if (program.intrinsics.void.equals(node)) {
-                    if (this.currentSemantic)
-                        throw new WTypeError(node.origin.originString, "Void can't have a semantic");
-                } else
-                    this.result.push(new Item(node, this.currentSemantic));
-            }
-
-            visitStructType(node)
-            {
-                if (this.currentSemantic != null)
-                    throw new WTypeError(node.origin.originString, "Structs inside entry point signatures can't have semantics.");
-                for (let field of node.fields) {
-                    this.currentSemantic = field.semantic;
-                    field.type.visit(this);
-                }
-            }
-
-            visitTypeRef(node)
-            {
-                node.type.visit(this);
-            }
-
-            visitPtrType(node)
-            {
-                this.result.push(new Item(node, this.currentSemantic));
-            }
-
-            visitArrayRefType(node)
-            {
-                this.result.push(new Item(node, this.currentSemantic));
-            }
-
-            visitArrayType(node)
-            {
-                this.result.push(new Item(node, this.currentSemantic));
-            }
-
-            visitFuncParameter(node)
-            {
-                this._currentSemantic = node.semantic;
-                node.type.visit(this);
-            }
-        }
-
-        let inputGatherer = new Gatherer();
-        for (let parameter of node.parameters) {
-            inputGatherer.reset();
-            parameter.visit(inputGatherer);
-        }
-        let outputGatherer = new Gatherer(node.semantic);
-        node.returnType.visit(outputGatherer);
-
-        function checkDuplicateSemantics(items) {
-            // FIXME: Make this faster than O(n^2)
-            for (let i = 0; i < items.length; ++i) {
-                for (let j = i + 1; j < items.length; ++j) {
-                    if (items[i].semantic && items[i].semantic.equalToOtherSemantic(items[j].semantic))
-                        throw new WTypeError(node.origin.originString, `Duplicate semantic found in entry point: ${items[i].semantic}`);
-                }
-            }
-        }
-        checkDuplicateSemantics(inputGatherer.result);
-        checkDuplicateSemantics(outputGatherer.result);
-
-        function checkSemanticTypes(items) {
-            for (let item of items) {
-                if (item.semantic && !item.semantic.isAcceptableType(item.type, program))
-                    throw new WTypeError(node.origin.originString, `Semantic ${item.semantic} is unacceptable type ${item.type}`);
-            }
-        }
-        checkSemanticTypes(inputGatherer.result);
-        checkSemanticTypes(outputGatherer.result);
-
-        function checkSemanticForShaderType(items, direction) {
-            for (let item of items) {
-                if (item.semantic && !item.semantic.isAcceptableForShaderType(direction, node.shaderType))
-                    throw new WTypeError(node.origin.originString, `Semantic ${item.semantic} is unacceptable as an ${direction} of shader type ${node.shaderType}`);
-            }
-        }
-        checkSemanticForShaderType(inputGatherer.result, "input");
-        checkSemanticForShaderType(outputGatherer.result, "output");
-
-        class PODChecker extends Visitor {
-            visitEnumType(node)
-            {
-                return true;
-            }
-
-            visitArrayType(node)
-            {
-                return node.elementType.visit(this);
-            }
-
-            visitVectorType(node)
-            {
-                return true;
-            }
-
-            visitMatrixType(node)
-            {
-                return true;
-            }
-
-            visitNativeType(node)
-            {
-                return node.isNumber;
-            }
-
-            visitPtrType(node)
-            {
-                return false;
-            }
-
-            visitArrayRefType(node)
-            {
-                return false;
-            }
-
-            visitStructType(node)
-            {
-                let result = true;
-                for (let field of node.fields)
-                    result = result && field.visit(this);
-                return result;
-            }
-
-            visitTypeRef(node)
-            {
-                return node.type.visit(this);
-            }
-        }
-        function checkPODData(items) {
-            for (let item of items) {
-                if ((item.type instanceof PtrType) || (item.type instanceof ArrayRefType) || (item.type instanceof ArrayType)) {
-                    if (!item.type.elementType.visit(new PODChecker()))
-                        throw new WTypeError(node.origin.originString, "Buffer attached to entry point needs to only contain POD types");
-                }
-            }
-        }
-        checkPODData(inputGatherer.result);
-        checkPODData(outputGatherer.result);
-    }
-
-    _checkShaderType(node)
-    {
-        switch (node.shaderType) {
-        case "vertex":
-            if (this._vertexEntryPoints.has(node.name))
-                throw new WTypeError(node.origin.originString, "Duplicate vertex entry point name " + node.name);
-            this._vertexEntryPoints.add(node.name);
-            break;
-        case "fragment":
-            if (this._fragmentEntryPoints.has(node.name))
-                throw new WTypeError(node.origin.originString, "Duplicate fragment entry point name " + node.name);
-            this._fragmentEntryPoints.add(node.name);
-            break;
-        case "compute":
-            if (this._computeEntryPoints.has(node.name))
-                throw new WTypeError(node.origin.originString, "Duplicate compute entry point name " + node.name);
-            this._computeEntryPoints.add(node.name);
-            break;
-        case "test":
-            break;
-        default:
-            throw new Error("Bad shader type: " + node.shaderType);
-        }
-    }
-
-    _checkOperatorOverload(func, resolveFuncs)
-    {
-        if (Lexer.textIsIdentifier(func.name))
-            return; // Not operator!
-
-        if (!func.name.startsWith("operator"))
-            throw new Error("Bad operator overload name: " + func.name);
-
-        let checkGetter = (kind) => {
-            let numExpectedParameters = kind == "index" ? 2 : 1;
-            if (func.parameters.length != numExpectedParameters)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected " + numExpectedParameters + ", got " + func.parameters.length + ")");
-            if (func.parameterTypes[0].unifyNode.isPtr)
-                throw new WTypeError(func.origin.originString, "Cannot have getter for pointer type: " + func.parameterTypes[0]);
-        };
-
-        let checkSetter = (kind) => {
-            let numExpectedParameters = kind == "index" ? 3 : 2;
-            if (func.parameters.length != numExpectedParameters)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected " + numExpectedParameters + ", got " + func.parameters.length + ")");
-            if (func.parameterTypes[0].unifyNode.isPtr)
-                throw new WTypeError(func.origin.originString, "Cannot have setter for pointer type: " + func.parameterTypes[0]);
-            if (!func.returnType.equals(func.parameterTypes[0]))
-                throw new WTypeError(func.origin.originString, "First parameter type and return type of setter must match (parameter was " + func.parameterTypes[0] + " but return was " + func.returnType + ")");
-            let valueType = func.parameterTypes[numExpectedParameters - 1];
-            let getterName = func.name.substr(0, func.name.length - 1);
-            let getterFuncs = resolveFuncs(getterName);
-            if (!getterFuncs)
-                throw new WTypeError(func.origin.originString, "Every setter must have a matching getter, but did not find any function named " + getterName + " to match " + func.name);
-            let argumentTypes = func.parameterTypes.slice(0, numExpectedParameters - 1);
-            let overload = resolveOverloadImpl(getterFuncs, argumentTypes, null);
-            if (!overload.func)
-                throw new WTypeError(func.origin.originString, "Did not find function named " + func.name + " with arguments " + argumentTypes + (overload.failures.length ? "; tried:\n" + overload.failures.join("\n") : ""));
-            let resultType = overload.func.returnType;
-            if (!resultType.equals(valueType))
-                throw new WTypeError(func.origin.originString, "Setter and getter must agree on value type (getter at " + overload.func.origin.originString + " says " + resultType + " while this setter says " + valueType + ")");
-        };
-
-        let checkAnder = (kind) => {
-            let numExpectedParameters = kind == "index" ? 2 : 1;
-            if (func.parameters.length != numExpectedParameters)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected " + numExpectedParameters + ", got " + func.parameters.length + ")");
-            if (!func.returnType.unifyNode.isPtr)
-                throw new WTypeError(func.origin.originString, "Return type of ander is not a pointer: " + func.returnType);
-            if (!func.parameterTypes[0].unifyNode.isRef)
-                throw new WTypeError(func.origin.originString, "Parameter to ander is not a reference: " + func.parameterTypes[0]);
-        };
-
-        switch (func.name) {
-        case "operator cast":
-            break;
-        case "operator++":
-        case "operator--":
-            if (func.parameters.length != 1)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected 1, got " + func.parameters.length + ")");
-            if (!func.parameterTypes[0].equals(func.returnType))
-                throw new WTypeError(func.origin.originString, "Parameter type and return type must match for " + func.name + " (parameter is " + func.parameterTypes[0] + " while return is " + func.returnType + ")");
-            break;
-        case "operator+":
-        case "operator-":
-            if (func.parameters.length != 1 && func.parameters.length != 2)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected 1 or 2, got " + func.parameters.length + ")");
-            break;
-        case "operator*":
-        case "operator/":
-        case "operator%":
-        case "operator&":
-        case "operator|":
-        case "operator^":
-        case "operator<<":
-        case "operator>>":
-            if (func.parameters.length != 2)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected 2, got " + func.parameters.length + ")");
-            break;
-        case "operator~":
-            if (func.parameters.length != 1)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected 1, got " + func.parameters.length + ")");
-            break;
-        case "operator==":
-        case "operator<":
-        case "operator<=":
-        case "operator>":
-        case "operator>=":
-            if (func.parameters.length != 2)
-                throw new WTypeError(func.origin.originString, "Incorrect number of parameters for " + func.name + " (expected 2, got " + func.parameters.length + ")");
-            if (!func.returnType.equals(this._program.intrinsics.bool))
-                throw new WTypeError(func.origin.originString, "Return type of " + func.name + " must be bool but was " + func.returnType);
-            break;
-        case "operator[]":
-            checkGetter("index");
-            break;
-        case "operator[]=":
-            checkSetter("index");
-            break;
-        case "operator&[]":
-            checkAnder("index");
-            break;
-        default:
-            if (func.name.startsWith("operator.")) {
-                if (func.name.endsWith("="))
-                    checkSetter("dot");
-                else
-                    checkGetter("dot");
-                break;
-            }
-            if (func.name.startsWith("operator&.")) {
-                checkAnder("dot");
-                break;
-            }
-            throw new Error("Parser accepted unrecognized operator: " + func.name);
-        }
-    }
-
-    visitFuncDef(node)
-    {
-        if (node.shaderType) {
-            this._checkShaderType(node);
-            this._checkSemantics(node);
-        }
-        this._checkOperatorOverload(node, name => this._program.functions.get(name));
-        node.body.visit(this);
-    }
-
-    visitEnumType(node)
-    {
-        node.baseType.visit(this);
-
-        let baseType = node.baseType.unifyNode;
-
-        if (!baseType.isInt)
-            throw new WTypeError(node.origin.originString, "Base type of enum is not an integer: " + node.baseType);
-
-        for (let member of node.members) {
-            if (!member.value)
-                continue;
-
-            let memberType = member.value.visit(this);
-            if (!baseType.equalsWithCommit(memberType))
-                throw new WTypeError(member.origin.originString, "Type of enum member " + member.value.name + " does not patch enum base type (member type is " + memberType + ", enum base type is " + node.baseType + ")");
-        }
-
-        let nextValue = baseType.defaultValue;
-        for (let member of node.members) {
-            if (member.value) {
-                nextValue = baseType.successorValue(member.value.unifyNode.valueForSelectedType);
-                continue;
-            }
-
-            member.value = baseType.createLiteral(member.origin, nextValue);
-            nextValue = baseType.successorValue(nextValue);
-        }
-
-        let memberArray = Array.from(node.members);
-        for (let i = 0; i < memberArray.length; ++i) {
-            let member = memberArray[i];
-            for (let j = i + 1; j < memberArray.length; ++j) {
-                let otherMember = memberArray[j];
-                if (baseType.valuesEqual(member.value.unifyNode.valueForSelectedType, otherMember.value.unifyNode.valueForSelectedType))
-                    throw new WTypeError(otherMember.origin.originString, "Duplicate enum member value (" + member.name + " has " + member.value + " while " + otherMember.name + " has " + otherMember.value + ")");
-            }
-        }
-
-        let foundZero = false;
-        for (let member of node.members) {
-            if (baseType.valuesEqual(member.value.unifyNode.valueForSelectedType, baseType.defaultValue)) {
-                foundZero = true;
-                break;
-            }
-        }
-        if (!foundZero)
-            throw new WTypeError(node.origin.originString, "Enum does not have a member with the value zero");
-    }
-
-    visitTypeRef(node)
-    {
-        if (!node.type)
-            throw new Error("Type reference without a type in checker: " + node + " at " + node.origin);
-        // All the structs will be visited by visitProgram() iterating through each top-level type.
-        // We don't want to recurse here because the contents of structs can refer to themselves (e.g. a linked list),
-        // and this would can an infinite loop.
-        // Typedefs can't refer to themselves because we check that in TypeDefResolver.
-        if (!(node.type instanceof StructType))
-            node.type.visit(this);
-    }
-
-    visitVectorType(node)
-    {
-        node.elementType.visit(this);
-        node.numElements.visit(this);
-
-        let isKnownAllowedVectorElementType = false;
-        for (let vectorElementTypeName of VectorElementTypes) {
-            const vectorElementType = this._program.globalNameContext.get(Type, vectorElementTypeName);
-            if (!vectorElementType)
-                throw new WTypeError(`${vectorElementType} is listed in VectorElementTypes, but it is not a known native type in the standard library or intrinsics.`);
-            if (vectorElementType.equals(node.elementType)) {
-                isKnownAllowedVectorElementType = true;
-                break;
-            }
-        }
-
-        if (!isKnownAllowedVectorElementType)
-            throw new WTypeError(`${node.elementType} is not a permitted vector element type.`);
-        if (node.numElementsValue != 2 && node.numElementsValue != 3 && node.numElementsValue != 4)
-            throw new WTypeError(`${node.toString()}: ${node.numElementsValue} is not 2, 3, or 4.`);
-    }
-
-    visitMatrixType(node)
-    {
-        node.elementType.visit(this);
-        node.numRows.visit(this);
-        node.numColumns.visit(this);
-
-        let isKnownAllowedVectorElementType = false;
-        for (let elementTypeName of ["half", "float"]) {
-            const elementType = this._program.globalNameContext.get(Type, elementTypeName);
-            if (!elementType)
-                throw new WTypeError(`${elementTypeName} is not a known native type in the standard library or intrinsics.`);
-            if (elementType.equals(node.elementType)) {
-                isKnownAllowedVectorElementType = true;
-                break;
-            }
-        }
-
-        if (!isKnownAllowedVectorElementType)
-            throw new WTypeError(`${node.elementType} is not a permitted vector element type.`);
-        if (node.numRowsValue != 2 && node.numRowsValue != 3 && node.numRowsValue != 4)
-            throw new WTypeError(`${node.toString()}: ${node.numRowsValue} is not 2, 3, or 4.`);
-        if (node.numColumnsValue != 2 && node.numColumnsValue != 3 && node.numColumnsValue != 4)
-            throw new WTypeError(`${node.toString()}: ${node.numColumnsValue} is not 2, 3, or 4.`);
-    }
-
-    visitArrayType(node)
-    {
-        node.elementType.visit(this);
-
-        if (!node.numElements.isConstexpr)
-            throw new WTypeError(node.origin.originString, "Array length must be constexpr");
-
-        let type = node.numElements.visit(this);
-
-        if (!type.equalsWithCommit(this._program.intrinsics.uint))
-            throw new WTypeError(node.origin.originString, "Array length must be a uint");
-    }
-
-    visitVariableDecl(node)
-    {
-        node.type.visit(this);
-        if (node.initializer) {
-            let lhsType = node.type;
-            let rhsType = node.initializer.visit(this);
-            if (!lhsType.equalsWithCommit(rhsType))
-                throw new WTypeError(node.origin.originString, "Type mismatch in variable initialization: " + lhsType + " versus " + rhsType);
-        }
-    }
-
-    visitAssignment(node)
-    {
-        let lhsType = node.lhs.visit(this);
-        if (!node.lhs.isLValue)
-            throw new WTypeError(node.origin.originString, "LHS of assignment is not an LValue: " + node.lhs + node.lhs.notLValueReasonString);
-        if (!isAddressSpace(node.lhs.addressSpace))
-            throw new Error(`${node.origin.originString}: Unknown address space in node ${node.lhs}`);
-        if (node.lhs.addressSpace == "constant")
-            throw new WTypeError(node.origin.originString, "Cannot assign to variable in the constant address space.");
-        let rhsType = node.rhs.visit(this);
-        if (!lhsType.equalsWithCommit(rhsType))
-            throw new WTypeError(node.origin.originString, "Type mismatch in assignment: " + lhsType + " versus " + rhsType);
-        node.type = lhsType;
-        return lhsType;
-    }
-
-    visitIdentityExpression(node)
-    {
-        return node.target.visit(this);
-    }
-
-    visitReadModifyWriteExpression(node)
-    {
-        let lhsType = node.lValue.visit(this);
-        if (!node.lValue.isLValue)
-            throw new WTypeError(node.origin.originString, "LHS of read-modify-write is not an LValue: " + node.lValue + node.lValue.notLValueReasonString);
-        node.oldValueVar.type = lhsType;
-        node.newValueVar.type = lhsType;
-        node.oldValueVar.visit(this);
-        node.newValueVar.visit(this);
-        let newValueType = node.newValueExp.visit(this);
-        if (!lhsType.equalsWithCommit(newValueType))
-            return new WTypeError(node.origin.originString, "Type mismatch in read-modify-write: " + lhsType + " versus " + newValueType);
-        return node.resultExp.visit(this);
-    }
-
-    visitAnonymousVariable(node)
-    {
-        if (!node.type)
-            throw new Error("Anonymous variable must know type before first appearance");
-    }
-
-    visitDereferenceExpression(node)
-    {
-        let type = node.ptr.visit(this).unifyNode;
-        if (!type.isPtr)
-            throw new WTypeError(node.origin.originString, "Type passed to dereference is not a pointer: " + type);
-        node.type = type.elementType;
-        node.addressSpace = type.addressSpace;
-        if (!node.addressSpace)
-            throw new Error("Null address space in type: " + type);
-        return node.type;
-    }
-
-    visitMakePtrExpression(node)
-    {
-        let elementType = node.lValue.visit(this).unifyNode;
-        if (!node.lValue.isLValue)
-            throw new WTypeError(node.origin.originString, "Operand to & is not an LValue: " + node.lValue + node.lValue.notLValueReasonString);
-
-        return new PtrType(node.origin, node.lValue.addressSpace, elementType);
-    }
-
-    visitMakeArrayRefExpression(node)
-    {
-        let elementType = node.lValue.visit(this).unifyNode;
-        if (elementType.isPtr) {
-            node.become(new ConvertPtrToArrayRefExpression(node.origin, node.lValue));
-            return new ArrayRefType(node.origin, elementType.addressSpace, elementType.elementType);
-        }
-
-        if (!node.lValue.isLValue)
-            throw new WTypeError(node.origin.originString, "Operand to @ is not an LValue: " + node.lValue + node.lValue.notLValueReasonString);
-
-        if (elementType.isArray) {
-            node.numElements = elementType.numElements;
-            elementType = elementType.elementType;
-        } else
-            node.numElements = UintLiteral.withType(node.origin, 1, this._program.intrinsics.uint);
-
-        return new ArrayRefType(node.origin, node.lValue.addressSpace, elementType);
-    }
-
-    visitConvertToArrayRefExpression(node)
-    {
-        throw new Error("Should not exist yet.");
-    }
-
-    _finishVisitingPropertyAccess(node, baseType, extraArgs, extraArgTypes)
-    {
-        baseType = baseType.visit(new AutoWrapper())
-        node.baseType = baseType;
-
-        // Such a type must exist. This may throw if it doesn't.
-        let typeForAnd = baseType.argumentTypeForAndOverload(node.origin);
-        if (!typeForAnd)
-            throw new Error("Cannot get typeForAnd");
-
-        let errorForGet;
-        let errorForAnd;
-
-        try {
-            let result = CallExpression.resolve(
-                node.origin, node.possibleGetOverloads,
-                node.getFuncName, [node.base, ...extraArgs], [baseType, ...extraArgTypes], null, this._program);
-            node.callForGet = result.call;
-            node.resultTypeForGet = result.resultType;
-        } catch (e) {
-            if (!(e instanceof WTypeError))
-                throw e;
-            errorForGet = e;
-        }
-
-        try {
-            let baseForAnd = baseType.argumentForAndOverload(node.origin, node.base);
-
-            let result = CallExpression.resolve(
-                node.origin, node.possibleAndOverloads,
-                node.andFuncName, [baseForAnd, ...extraArgs], [typeForAnd, ...extraArgTypes],
-                null, this._program);
-            node.callForAnd = result.call;
-            node.resultTypeForAnd = result.resultType.unifyNode.returnTypeFromAndOverload(node.origin);
-        } catch (e) {
-            if (!(e instanceof WTypeError))
-                throw e;
-            errorForAnd = e;
-        }
-
-        if (!node.resultTypeForGet && !node.resultTypeForAnd) {
-            throw new WTypeError(
-                node.origin.originString,
-                "Cannot resolve access; tried by-value:\n" +
-                errorForGet.typeErrorMessage + "\n" +
-                "and tried by-pointer:\n" +
-                errorForAnd.typeErrorMessage);
-        }
-
-        if (node.resultTypeForGet && node.resultTypeForAnd
-            && !node.resultTypeForGet.equals(node.resultTypeForAnd))
-            throw new WTypeError(node.origin.originString, "Result type resolved by-value (" + node.resultTypeForGet + ") does not match result type resolved by-pointer (" + node.resultTypeForAnd + ")");
-
-        try {
-            let result = CallExpression.resolve(
-                node.origin, node.possibleSetOverloads,
-                node.setFuncName, [node.base, ...extraArgs, null], [baseType, ...extraArgTypes, node.resultType], null, this._program);
-            node.callForSet = result.call;
-            if (!result.resultType.equals(baseType))
-                throw new WTypeError(node.origin.originString, "Result type of setter " + result.call.func + " is not the base type " + baseType);
-        } catch (e) {
-            if (!(e instanceof WTypeError))
-                throw e;
-            node.errorForSet = e;
-        }
-
-        // OK, now we need to determine if we are an lvalue. We are an lvalue if we can be assigned to. We can
-        // be assigned to if we have an ander or setter. But it's weirder than that. We also need the base to be
-        // an lvalue, except unless the base is an array reference.
-        if (!node.callForAnd && !node.callForSet) {
-            node.isLValue = false;
-            node.notLValueReason =
-                "Have neither ander nor setter. Tried setter:\n" +
-                node.errorForSet.typeErrorMessage + "\n" +
-                "and tried ander:\n" +
-                errorForAnd.typeErrorMessage;
-        } else if (!node.base.isLValue && !baseType.isArrayRef) {
-            node.isLValue = false;
-            node.notLValueReason = "Base of property access is neither a lvalue nor an array reference";
-        } else {
-            node.isLValue = true;
-            node.addressSpace = baseType.addressSpace ? baseType.addressSpace : node.base.addressSpace;
-        }
-
-        return node.resultType;
-    }
-
-    visitDotExpression(node)
-    {
-        let structType = node.struct.visit(this).unifyNode;
-        return this._finishVisitingPropertyAccess(node, structType, [], []);
-    }
-
-    visitIndexExpression(node)
-    {
-        let arrayType = node.array.visit(this).unifyNode;
-        let indexType = node.index.visit(this);
-
-        return this._finishVisitingPropertyAccess(node, arrayType, [node.index], [indexType]);
-    }
-
-    visitVariableRef(node)
-    {
-        if (!node.variable.type)
-            throw new Error("Variable has no type: " + node.variable);
-        return node.variable.type;
-    }
-
-    visitReturn(node)
-    {
-        if (node.value) {
-            let resultType = node.value.visit(this);
-            if (!resultType)
-                throw new Error("Null result type from " + node.value);
-            if (!node.func.returnType.equalsWithCommit(resultType))
-                throw new WTypeError(node.origin.originString, "Trying to return " + resultType + " in a function that returns " + node.func.returnType);
-            return;
-        }
-
-        if (!node.func.returnType.equalsWithCommit(this._program.intrinsics.void))
-            throw new WTypeError(node.origin.originString, "Non-void function must return a value");
-    }
-
-    visitGenericLiteral(node)
-    {
-        return node.type;
-    }
-
-    visitNullLiteral(node)
-    {
-        return node.type;
-    }
-
-    visitBoolLiteral(node)
-    {
-        return this._program.intrinsics.bool;
-    }
-
-    visitEnumLiteral(node)
-    {
-        return node.member.enumType;
-    }
-
-    _requireBool(expression)
-    {
-        let type = expression.visit(this);
-        if (!type)
-            throw new Error("Expression has no type, but should be bool: " + expression);
-        if (!type.equals(this._program.intrinsics.bool))
-            throw new WTypeError("Expression isn't a bool: " + expression);
-    }
-
-    visitLogicalNot(node)
-    {
-        this._requireBool(node.operand);
-        return this._program.intrinsics.bool;
-    }
-
-    visitLogicalExpression(node)
-    {
-        this._requireBool(node.left);
-        this._requireBool(node.right);
-        return this._program.intrinsics.bool;
-    }
-
-    visitIfStatement(node)
-    {
-        this._requireBool(node.conditional);
-        node.body.visit(this);
-        if (node.elseBody)
-            node.elseBody.visit(this);
-    }
-
-    visitWhileLoop(node)
-    {
-        this._requireBool(node.conditional);
-        node.body.visit(this);
-    }
-
-    visitDoWhileLoop(node)
-    {
-        node.body.visit(this);
-        this._requireBool(node.conditional);
-    }
-
-    visitForLoop(node)
-    {
-        if (node.initialization)
-            node.initialization.visit(this);
-        if (node.condition)
-            this._requireBool(node.condition);
-        if (node.increment)
-            node.increment.visit(this);
-        node.body.visit(this);
-    }
-
-    visitSwitchStatement(node)
-    {
-        let type = node.value.visit(this).commit();
-
-        if (!type.unifyNode.isInt && !(type.unifyNode instanceof EnumType))
-            throw new WTypeError(node.origin.originString, "Cannot switch on non-integer/non-enum type: " + type);
-
-        node.type = type;
-
-        let hasDefault = false;
-
-        for (let switchCase of node.switchCases) {
-            switchCase.body.visit(this);
-
-            if (switchCase.isDefault) {
-                hasDefault = true;
-                continue;
-            }
-
-            if (!switchCase.value.isConstexpr)
-                throw new WTypeError(switchCase.origin.originString, "Switch case not constexpr: " + switchCase.value);
-
-            let caseType = switchCase.value.visit(this);
-            if (!type.equalsWithCommit(caseType))
-                throw new WTypeError(switchCase.origin.originString, "Switch case type does not match switch value type (case type is " + caseType + " but switch value type is " + type + ")");
-        }
-
-        for (let i = 0; i < node.switchCases.length; ++i) {
-            let firstCase = node.switchCases[i];
-            for (let j = i + 1; j < node.switchCases.length; ++j) {
-                let secondCase = node.switchCases[j];
-
-                if (firstCase.isDefault != secondCase.isDefault)
-                    continue;
-
-                if (firstCase.isDefault)
-                    throw new WTypeError(secondCase.origin.originString, "Duplicate default case in switch statement");
-
-                let valuesEqual = type.unifyNode.valuesEqual(
-                    firstCase.value.unifyNode.valueForSelectedType,
-                    secondCase.value.unifyNode.valueForSelectedType);
-                if (valuesEqual)
-                    throw new WTypeError(secondCase.origin.originString, "Duplicate case in switch statement for value " + firstCase.value.unifyNode.valueForSelectedType);
-            }
-        }
-
-        if (!hasDefault) {
-            let includedValues = new Set();
-            for (let switchCase of node.switchCases)
-                includedValues.add(switchCase.value.unifyNode.valueForSelectedType);
-
-            for (let {value, name} of type.unifyNode.allValues()) {
-                if (!includedValues.has(value))
-                    throw new WTypeError(node.origin.originString, "Value not handled by switch statement: " + name);
-            }
-        }
-    }
-
-    visitCommaExpression(node)
-    {
-        let result = null;
-        for (let expression of node.list)
-            result = expression.visit(this);
-        return result;
-    }
-
-    visitTernaryExpression(node)
-    {
-        this._requireBool(node.predicate);
-        let bodyType = node.bodyExpression.visit(this);
-        let elseType = node.elseExpression.visit(this);
-        if (!bodyType)
-            throw new Error("Ternary expression body has no type: " + node.bodyExpression);
-        if (!elseType)
-            throw new Error("Ternary expression else has no type: " + node.elseExpression);
-        if (!bodyType.equalsWithCommit(elseType))
-            throw new WTypeError(node.origin.originString, "Body and else clause of ternary statement don't have the same type: " + node);
-        return bodyType;
-    }
-    
-    visitCallExpression(node)
-    {
-        let argumentTypes = node.argumentList.map(argument => {
-            let newArgument = argument.visit(this);
-            if (!newArgument)
-                throw new Error("visitor returned null for " + argument);
-            return newArgument.visit(new AutoWrapper());
-        });
-
-        node.argumentTypes = argumentTypes;
-        if (node.returnType)
-            node.returnType.visit(this);
-
-        let result = node.resolve(node.possibleOverloads, this._program);
-        return result;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CloneProgram.js b/Tools/WebGPUShadingLanguageRI/CloneProgram.js
deleted file mode 100644 (file)
index b9eddad..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-// This is only currently used to clone programs just after parsing, so it doesn't really need to be
-// able to handle all aspects of what Rewriter would need to do.
-
-function cloneProgram(program)
-{
-    let result = new Program();
-    let cloner = new StatementCloner();
-    for (let statement of program.topLevelStatements)
-        result.add(statement.visit(cloner));
-    return result;
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CommaExpression.js b/Tools/WebGPUShadingLanguageRI/CommaExpression.js
deleted file mode 100644 (file)
index 3f3ca36..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class CommaExpression extends Expression {
-    constructor(origin, list)
-    {
-        super(origin);
-        this._list = list;
-        for (let expression of list) {
-            if (!expression)
-                throw new Error("null expression");
-        }
-    }
-    
-    get list() { return this._list; }
-    
-    // NOTE: It's super tempting to say that CommaExpression is an lValue if its last entry is an lValue. But,
-    // PropertyResolver relies on this not being the case.
-    
-    toString()
-    {
-        return "(" + this.list.toString() + ")";
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/ConstexprFolder.js b/Tools/WebGPUShadingLanguageRI/ConstexprFolder.js
deleted file mode 100644 (file)
index 36e5f6f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-// NOTE: This doesn't let you negate constexpr variables. I think that's probably OK for now, but we should
-// fix that eventually.
-// https://bugs.webkit.org/show_bug.cgi?id=177121
-
-class ConstexprFolder extends Visitor {
-    visitCallExpression(node)
-    {
-        super.visitCallExpression(node);
-        
-        if (node.name == "operator-"
-            && node.argumentList.length == 1
-            && node.argumentList[0].isLiteral
-            && node.argumentList[0].negConstexpr) {
-            node.become(node.argumentList[0].negConstexpr(node.origin));
-            return;
-        }
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/Continue.js b/Tools/WebGPUShadingLanguageRI/Continue.js
deleted file mode 100644 (file)
index cb5cc93..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Continue extends Node {
-    constructor(origin)
-    {
-        super();
-        this._origin = origin;
-    }
-    
-    get origin() { return this._origin; }
-    
-    toString()
-    {
-        return "Continue";
-    }
-};
-
diff --git a/Tools/WebGPUShadingLanguageRI/ConvertPtrToArrayRefExpression.js b/Tools/WebGPUShadingLanguageRI/ConvertPtrToArrayRefExpression.js
deleted file mode 100644 (file)
index 2a8db4b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class ConvertPtrToArrayRefExpression extends Expression {
-    constructor(origin, lValue)
-    {
-        super(origin);
-        this._lValue = lValue;
-    }
-    
-    get lValue() { return this._lValue; }
-    
-    toString()
-    {
-        return "@(" + this.lValue + ")";
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CreateLiteral.js b/Tools/WebGPUShadingLanguageRI/CreateLiteral.js
deleted file mode 100644 (file)
index c470d93..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function createLiteral(config)
-{
-    class GenericLiteral extends Expression {
-        constructor(origin, value)
-        {
-            super(origin);
-            this._value = value;
-            this.type = config.createType.call(this, origin, value);
-        }
-        
-        static withType(origin, value, type)
-        {
-            let result = new GenericLiteral(origin, value);
-            result.type = TypeRef.wrap(type);
-            return result;
-        }
-        
-        get value() { return this._value; }
-        
-        // This is necessary because once we support int64, we'll need that to be represented as an object
-        // rather than as a primitive. Then we'll need to convert.
-        get valueForSelectedType()
-        {
-            let type = this.type.type.unifyNode;
-            if (!type)
-                throw new Error("Cannot get type for " + this);
-            let func = type["formatValueFrom" + config.literalClassName];
-            if (!func)
-                throw new Error("Cannot get function to format type for " + config.literalClassName + " from " + type);
-            return func.call(type, this.value);
-        }
-        
-        get isConstexpr() { return true; }
-        get isLiteral() { return true; }
-        
-        get negConstexpr()
-        {
-            if (!config.negConstexpr)
-                return null;
-            
-            return () => config.negConstexpr.call(this);
-        }
-        
-        unifyImpl(unificationContext, other)
-        {
-            if (!(other instanceof GenericLiteral))
-                return false;
-            return this.value == other.value;
-        }
-        
-        toString()
-        {
-            return config.preferredTypeName + "Literal<" + this.value + ">";
-        }
-    }
-    
-    return GenericLiteral;
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/CreateLiteralType.js b/Tools/WebGPUShadingLanguageRI/CreateLiteralType.js
deleted file mode 100644 (file)
index 8c5df26..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function createLiteralType(config)
-{
-    class GenericLiteralType extends Type {
-        constructor(origin, value)
-        {
-            super();
-            this._origin = origin;
-            this._value = value;
-            this.preferredType = new TypeRef(origin, config.preferredTypeName);
-        }
-        
-        get origin() { return this._origin; }
-        get value() { return this._value; }
-        
-        get isPrimitive() { return true; }
-        get isUnifiable() { return true; }
-        get isLiteral() { return true; }
-        
-        typeVariableUnify(unificationContext, other)
-        {
-            if (!(other instanceof Type))
-                return false;
-            
-            return this._typeVariableUnifyImpl(unificationContext, other);
-        }
-        
-        unifyImpl(unificationContext, other)
-        {
-            return this.typeVariableUnify(unificationContext, other);
-        }
-        
-        prepareToVerify(unificationContext)
-        {
-            let realThis = unificationContext.find(this);
-            if (realThis.isLiteral) {
-                return () => {
-                    if (realThis.unify(unificationContext, this.preferredType))
-                        return {result: true};
-                    return {result: false, reason: "Type mismatch between " + unificationContext.find(realThis) + " and " + this.preferredType};
-                };
-            }
-        }
-        
-        verifyAsArgument(unificationContext)
-        {
-            return config.verifyAsArgument.call(this, unificationContext);
-        }
-        
-        verifyAsParameter(unificationContext)
-        {
-            throw new Error("GenericLiteralType should never be used as a type parameter");
-        }
-        
-        conversionCost(unificationContext)
-        {
-            let realThis = unificationContext.find(this);
-            if (realThis.equals(this.preferredType))
-                return 0;
-            return 1;
-        }
-        
-        commitUnification(unificationContext)
-        {
-            this.type = unificationContext.find(this).visit(new AutoWrapper());
-        }
-        
-        toString()
-        {
-            return config.preferredTypeName + "LiteralType<" + this.value + ">";
-        }
-    }
-    
-    return GenericLiteralType;
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/DereferenceExpression.js b/Tools/WebGPUShadingLanguageRI/DereferenceExpression.js
deleted file mode 100644 (file)
index 27444bf..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class DereferenceExpression extends Expression {
-    constructor(origin, ptr, type = null, addressSpace = null)
-    {
-        super(origin);
-        this._ptr = ptr;
-        this.type = type;
-        this.addressSpace = addressSpace;
-    }
-    
-    get ptr() { return this._ptr; }
-    get isLValue() { return true; }
-    
-    toString()
-    {
-        return "*(" + this.ptr + ")";
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/DoWhileLoop.js b/Tools/WebGPUShadingLanguageRI/DoWhileLoop.js
deleted file mode 100644 (file)
index a2b8a21..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class DoWhileLoop extends Node {
-    constructor(origin, body, conditional)
-    {
-        super();
-        this._origin = origin;
-        this._body = body;
-        this._conditional = conditional;
-    }
-
-    get origin() { return this._origin; }
-    get body() { return this._body; }
-    get conditional() { return this._conditional; }
-
-    toString()
-    {
-        return "do " + this.body + " while (" + this.conditional + ");";
-    }
-};
-
diff --git a/Tools/WebGPUShadingLanguageRI/DotExpression.js b/Tools/WebGPUShadingLanguageRI/DotExpression.js
deleted file mode 100644 (file)
index 110de8c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class DotExpression extends PropertyAccessExpression {
-    constructor(origin, struct, fieldName)
-    {
-        super(origin, struct);
-        this._fieldName = fieldName;
-    }
-    
-    get struct() { return this.base; }
-    get fieldName() { return this._fieldName; }
-    
-    get getFuncName() { return "operator." + this.fieldName; }
-    get andFuncName() { return "operator&." + this.fieldName; }
-    get setFuncName() { return "operator." + this.fieldName + "="; }
-    
-    toString()
-    {
-        return "(" + this.struct + "." + this.fieldName + ")";
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/EArrayRef.js b/Tools/WebGPUShadingLanguageRI/EArrayRef.js
deleted file mode 100644 (file)
index 912def7..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class EArrayRef {
-    constructor(ptr, length)
-    {
-        this._ptr = ptr;
-        this._length = length;
-    }
-    
-    get ptr() { return this._ptr; }
-    get length() { return this._length; }
-
-    equals(other)
-    {
-        return this.ptr.equals(other.ptr) && this.length == other.length;
-    }
-    
-    toString()
-    {
-        return "A:<" + this.ptr + ", " + this.length + ">";
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/EBuffer.js b/Tools/WebGPUShadingLanguageRI/EBuffer.js
deleted file mode 100644 (file)
index 1ef53e8..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-let eBufferCount = 0;
-let canAllocateEBuffers = true;
-
-class EBuffer {
-    constructor(size)
-    {
-        if (!canAllocateEBuffers)
-            throw new Error("Trying to allocate EBuffer while allocation is disallowed");
-        this._index = eBufferCount++;
-        this._array = new Array(size);
-    }
-    
-    static setCanAllocateEBuffers(value, callback)
-    {
-        let oldCanAllocateEBuffers = canAllocateEBuffers;
-        canAllocateEBuffers = value;
-        try {
-            return callback();
-        } finally {
-            canAllocateEBuffers = oldCanAllocateEBuffers;
-        }
-    }
-    
-    static disallowAllocation(callback)
-    {
-        return EBuffer.setCanAllocateEBuffers(false, callback);
-    }
-    
-    static allowAllocation(callback)
-    {
-        return EBuffer.setCanAllocateEBuffers(true, callback);
-    }
-    
-    get(index)
-    {
-        if (index < 0 || index >= this._array.length)
-            throw new Error("Out of bounds buffer access (buffer = " + this + ", index = " + index + ")");
-        return this._array[index];
-    }
-    
-    set(index, value)
-    {
-        if (index < 0 || index >= this._array.length)
-            throw new Error("out of bounds buffer access (buffer = " + this + ", index = " + index + ")");
-        this._array[index] = value;
-    }
-    
-    get index() { return this._index; }
-    
-    toString()
-    {
-        return "B" + this._index + ":[" + this._array + "]";
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/EBufferBuilder.js b/Tools/WebGPUShadingLanguageRI/EBufferBuilder.js
deleted file mode 100644 (file)
index a7f3616..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class EBufferBuilder extends Visitor {
-    _createEPtr(type)
-    {
-        if (type.size == null)
-            throw new Error("Type does not have size: " + type);
-        let buffer = new EBuffer(type.size);
-        if (!type.populateDefaultValue)
-            throw new Error("Cannot populateDefaultValue with: " + type);
-        type.populateDefaultValue(buffer, 0);
-        return new EPtr(buffer, 0);
-    }
-    
-    _createEPtrForNode(node)
-    {
-        if (!node.type)
-            throw new Error("node has no type: " + node);
-        node.ePtr = this._createEPtr(node.type);
-    }
-    
-    visitFuncParameter(node)
-    {
-        this._createEPtrForNode(node);
-    }
-    
-    visitVariableDecl(node)
-    {
-        this._createEPtrForNode(node);
-        if (node.initializer)
-            node.initializer.visit(this);
-    }
-    
-    visitFuncDef(node)
-    {
-        node.returnEPtr = this._createEPtr(node.returnType);
-        super.visitFuncDef(node);
-    }
-    
-    visitFunctionLikeBlock(node)
-    {
-        node.returnEPtr = this._createEPtr(node.returnType);
-        super.visitFunctionLikeBlock(node);
-    }
-    
-    visitCallExpression(node)
-    {
-        node.resultEPtr = this._createEPtr(node.resultType);
-        super.visitCallExpression(node);
-    }
-    
-    visitMakePtrExpression(node)
-    {
-        node.ePtr = EPtr.box();
-        super.visitMakePtrExpression(node);
-    }
-    
-    visitGenericLiteral(node)
-    {
-        node.ePtr = EPtr.box();
-    }
-    
-    visitNullLiteral(node)
-    {
-        node.ePtr = EPtr.box();
-    }
-    
-    visitBoolLiteral(node)
-    {
-        node.ePtr = EPtr.box();
-    }
-    
-    visitEnumLiteral(node)
-    {
-        node.ePtr = EPtr.box();
-    }
-    
-    visitLogicalNot(node)
-    {
-        node.ePtr = EPtr.box();
-        super.visitLogicalNot(node);
-    }
-    
-    visitLogicalExpression(node)
-    {
-        node.ePtr = EPtr.box();
-        super.visitLogicalExpression(node);
-    }
-    
-    visitAnonymousVariable(node)
-    {
-        this._createEPtrForNode(node);
-    }
-    
-    visitMakeArrayRefExpression(node)
-    {
-        node.ePtr = EPtr.box();
-        super.visitMakeArrayRefExpression(node);
-    }
-    
-    visitConvertPtrToArrayRefExpression(node)
-    {
-        node.ePtr = EPtr.box();
-        super.visitConvertPtrToArrayRefExpression(node);
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/EPtr.js b/Tools/WebGPUShadingLanguageRI/EPtr.js
deleted file mode 100644 (file)
index ef5b5b4..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class EPtr {
-    constructor(buffer, offset)
-    {
-        if (offset == null || offset != offset)
-            throw new Error("Bad offset: " + offset);
-        this._buffer = buffer;
-        this._offset = offset;
-    }
-    
-    // The interpreter always passes around pointers to things. This means that sometimes we will
-    // want to return a value but we have to "invent" a pointer to that value. No problem, this
-    // function is here to help.
-    //
-    // In a real execution environment, uses of this manifest as SSA temporaries.
-    static box(value)
-    {
-        return new EPtr(new EBuffer(1), 0).box(value);
-    }
-    
-    box(value)
-    {
-        this._buffer.set(0, value);
-        return this;
-    }
-    
-    get buffer() { return this._buffer; }
-    get offset() { return this._offset; }
-    
-    plus(offset)
-    {
-        return new EPtr(this.buffer, this.offset + offset);
-    }
-    
-    loadValue()
-    {
-        return this.buffer.get(this.offset);
-    }
-    
-    get(offset)
-    {
-        return this.buffer.get(this.offset + offset);
-    }
-    
-    set(offset, value)
-    {
-        this.buffer.set(this.offset + offset, value);
-    }
-    
-    copyFrom(other, size)
-    {
-        if (size == null)
-            throw new Error("Cannot copy null size");
-        for (let i = size; i--;)
-            this.set(i, other.get(i));
-    }
-
-    equals(other)
-    {
-        return this.buffer == other.buffer && this.offset == other.offset;
-    }
-    
-    toString()
-    {
-        return "B" + this.buffer.index + ":" + this.offset;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/EnumLiteral.js b/Tools/WebGPUShadingLanguageRI/EnumLiteral.js
deleted file mode 100644 (file)
index 114a79e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class EnumLiteral extends Expression {
-    constructor(origin, member)
-    {
-        super(origin);
-        this._member = member;
-    }
-    
-    get member() { return this._member; }
-    get type() { return this.member.enumType; }
-    get isConstexpr() { return true; }
-    
-    unifyImpl(unificationContext, other)
-    {
-        if (!(other instanceof EnumLiteral))
-            return false;
-        return this.member == other.member;
-    }
-    
-    get valueForSelectedType()
-    {
-        return this.member.value.unifyNode.valueForSelectedType;
-    }
-        
-    toString()
-    {
-        return this.member.enumType.name + "." + this.member.name;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/EnumMember.js b/Tools/WebGPUShadingLanguageRI/EnumMember.js
deleted file mode 100644 (file)
index 077abce..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class EnumMember extends Node {
-    constructor(origin, name, value)
-    {
-        super();
-        this._origin = origin;
-        this._name = name;
-        this.value = value;
-    }
-    
-    get origin() { return this._origin; }
-    get name() { return this._name; }
-    
-    toString()
-    {
-        let result = this.name;
-        if (this.value)
-            result += " = " + this.value;
-        return result;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/EnumType.js b/Tools/WebGPUShadingLanguageRI/EnumType.js
deleted file mode 100644 (file)
index c4a1551..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class EnumType extends Type {
-    constructor(origin, name, baseType)
-    {
-        super();
-        this._origin = origin;
-        this._name = name;
-        this._baseType = baseType;
-        this._members = new Map();
-    }
-    
-    add(member)
-    {
-        if (this._members.has(member.name))
-            throw new WTypeError(member.origin.originString, "Duplicate enum member name: " + member.name);
-        member.enumType = this;
-        this._members.set(member.name, member);
-    }
-    
-    get origin() { return this._origin; }
-    get name() { return this._name; }
-    get baseType() { return this._baseType; }
-    get isEnum() { return true; }
-    
-    get memberNames() { return this._members.keys(); }
-    memberByName(name) { return this._members.get(name); }
-    get members() { return this._members.values(); }
-    get memberMap() { return this._members; }
-    
-    get isPrimitive() { return true; }
-    
-    *allValues()
-    {
-        for (let member of this.members)
-            yield {value: member.value.unifyNode.valueForSelectedType, name: member.name};
-    }
-    
-    valuesEqual(a, b)
-    {
-        return this.baseType.unifyNode.valuesEqual(a, b);
-    }
-    
-    populateDefaultValue(buffer, offset)
-    {
-        this.baseType.populateDefaultValue(buffer, offset);
-    }
-    
-    get size() { return this.baseType.size; }
-    
-    toString()
-    {
-        return "enum " + this.name + " : " + this.baseType + " { " + Array.from(this.members).join(",") + " }";
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/EvaluationCommon.js b/Tools/WebGPUShadingLanguageRI/EvaluationCommon.js
deleted file mode 100644 (file)
index ba24304..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-const BreakException = Symbol("BreakException");
-const ContinueException = Symbol("ContinueException");
-
-
diff --git a/Tools/WebGPUShadingLanguageRI/Evaluator.js b/Tools/WebGPUShadingLanguageRI/Evaluator.js
deleted file mode 100644 (file)
index 51f778b..0000000
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-let _lastInvocationDidTrap;
-
-// This is a combined LHS/RHS evaluator that passes around EPtr's to everything.
-class Evaluator extends Visitor {
-    constructor(program)
-    {
-        super();
-        this._program = program;
-        _lastInvocationDidTrap = false;
-    }
-
-    static lastInvocationDidTrap()
-    {
-        return lastInvocationDidTrap;
-    }
-    
-    // You must snapshot if you use a value in rvalue context. For example, a call expression will
-    // snapshot all of its arguments immediately upon executing them. In general, it should not be
-    // possible for a pointer returned from a visit method in rvalue context to live across any effects.
-    _snapshot(type, dstPtr, srcPtr)
-    {
-        if (!srcPtr)
-            return null;
-        let size = type.size;
-        if (size == null)
-            throw new Error("Cannot get size of type: " + type + " (size = " + size + ", constructor = " + type.constructor.name + ")");
-        if (!dstPtr)
-            dstPtr = new EPtr(new EBuffer(size), 0);
-        dstPtr.copyFrom(srcPtr, size);
-        return dstPtr;
-    }
-    
-    runFunc(func)
-    {
-        return EBuffer.disallowAllocation(
-            () => this._runBody(func.returnType, func.returnEPtr, func.body, func.isEntryPoint));
-    }
-    
-    _runBody(type, ptr, block, isEntryPoint)
-    {
-        if (!ptr)
-            throw new Error("Null ptr");
-        try {
-            block.visit(this);
-            // FIXME: We should have a check that there is no way to drop out of a function without
-            // returning unless the function returns void.
-            return null;
-        } catch (e) {
-            if (e == BreakException || e == ContinueException)
-                throw new Error("Should not see break/continue at function scope");
-            if (e instanceof ReturnException)
-                return this._snapshot(type, ptr, e.value);
-            if (e instanceof WTrapError) {
-                if (isEntryPoint) {
-                    _lastInvocationDidTrap = true;
-                    type.populateDefaultValue(ptr.buffer, ptr.offset);
-                    return ptr;
-                }
-            }
-            throw e;
-        }
-    }
-
-    _evaluateArguments(argumentList, parameterList)
-    {
-        const callArguments = [];
-        for (let i = argumentList.length; i--;) {
-            const argument = argumentList[i];
-            const type = parameterList[i].type;
-            if (!type || !argument)
-                throw new Error("Cannot get type or argument; i = " + i + ", argument = " + argument + ", type = " + type);
-            let argumentValue = argument.visit(this);
-            if (!argumentValue)
-                throw new Error("Null argument value, i = " + i + ", node = " + node);
-            callArguments.unshift(EBuffer.allowAllocation(() => this._snapshot(type, null, argumentValue)));
-        }
-        return callArguments;
-    }
-
-    _evaluateFunction(node, argumentList, parameterList, funcBody, returnType, returnEPtr, isEntryPoint)
-    {
-        const argumentValues = this._evaluateArguments(argumentList, parameterList);
-        for (let i = 0; i < node.argumentList.length; ++i)
-            parameterList[i].ePtr.copyFrom(argumentValues[i], parameterList[i].type.size);
-        return EBuffer.allowAllocation(() => this._runBody(returnType, returnEPtr, funcBody, isEntryPoint));
-    }
-
-    visitFunctionLikeBlock(node)
-    {
-        return this._evaluateFunction(node, node.argumentList, node.parameters, node.body, node.returnType, node.returnEPtr, false);
-    }
-    
-    visitReturn(node)
-    {
-        throw new ReturnException(node.value ? node.value.visit(this) : null);
-    }
-    
-    visitVariableDecl(node)
-    {
-        if (!node.ePtr.buffer)
-            throw new Error("eptr without buffer in " + node);
-        node.type.populateDefaultValue(node.ePtr.buffer, node.ePtr.offset);
-        if (node.initializer)
-            node.ePtr.copyFrom(node.initializer.visit(this), node.type.size);
-    }
-    
-    visitAssignment(node)
-    {
-        let target = node.lhs.visit(this);
-        let source = node.rhs.visit(this);
-        target.copyFrom(source, node.type.size);
-        return target;
-    }
-    
-    visitIdentityExpression(node)
-    {
-        return node.target.visit(this);
-    }
-    
-    visitDereferenceExpression(node)
-    {
-        let ptr = node.ptr.visit(this).loadValue();
-        if (!ptr)
-            throw new WTrapError(node.origin.originString, "Null dereference");
-        return ptr;
-    }
-    
-    visitMakePtrExpression(node)
-    {
-        let ptr = node.lValue.visit(this);
-        return node.ePtr.box(ptr);
-    }
-    
-    visitMakeArrayRefExpression(node)
-    {
-        return node.ePtr.box(new EArrayRef(node.lValue.visit(this), node.numElements.visit(this).loadValue()));
-    }
-    
-    visitConvertPtrToArrayRefExpression(node)
-    {
-        return node.ePtr.box(new EArrayRef(node.lValue.visit(this).loadValue(), 1));
-    }
-    
-    visitCommaExpression(node)
-    {
-        let result;
-        for (let expression of node.list)
-            result = expression.visit(this);
-        // This should almost snapshot, except that tail-returning a pointer is totally OK.
-        return result;
-    }
-
-    visitTernaryExpression(node)
-    {
-        if (node.predicate.visit(this).loadValue())
-            return node.bodyExpression.visit(this);
-        return node.elseExpression.visit(this);
-    }
-    
-    visitVariableRef(node)
-    {
-        return node.variable.ePtr;
-    }
-    
-    visitGenericLiteral(node)
-    {
-        return node.ePtr.box(node.valueForSelectedType);
-    }
-    
-    visitNullLiteral(node)
-    {
-        return node.ePtr.box(null);
-    }
-    
-    visitBoolLiteral(node)
-    {
-        return node.ePtr.box(node.value);
-    }
-    
-    visitEnumLiteral(node)
-    {
-        return node.ePtr.box(node.member.value.unifyNode.valueForSelectedType);
-    }
-
-    visitLogicalNot(node)
-    {
-        let result = !node.operand.visit(this).loadValue();
-        return node.ePtr.box(result);
-    }
-
-    visitLogicalExpression(node)
-    {
-        let lhs = node.left.visit(this).loadValue();
-        let result;
-        switch (node.text) {
-        case "&&":
-            result = lhs && node.right.visit(this).loadValue();
-            break;
-        case "||":
-            result = lhs || node.right.visit(this).loadValue();
-            break;
-        default:
-            throw new Error("Unknown type of logical expression");
-        }
-        return node.ePtr.box(result);
-    }
-
-    visitIfStatement(node)
-    {
-        if (node.conditional.visit(this).loadValue())
-            return node.body.visit(this);
-        else if (node.elseBody)
-            return node.elseBody.visit(this);
-    }
-
-    visitWhileLoop(node)
-    {
-        while (node.conditional.visit(this).loadValue()) {
-            try {
-                node.body.visit(this);
-            } catch (e) {
-                if (e == BreakException)
-                    break;
-                if (e == ContinueException)
-                    continue;
-                throw e;
-            }
-        }
-    }
-
-    visitDoWhileLoop(node)
-    {
-        do {
-            try {
-                node.body.visit(this);
-            } catch (e) {
-                if (e == BreakException)
-                    break;
-                if (e == ContinueException)
-                    continue;
-                throw e;
-            }
-        } while (node.conditional.visit(this).loadValue());
-    }
-
-    visitForLoop(node)
-    {
-        for (node.initialization ? node.initialization.visit(this) : true;
-            node.condition ? node.condition.visit(this).loadValue() : true;
-            node.increment ? node.increment.visit(this) : true) {
-            try {
-                node.body.visit(this);
-            } catch (e) {
-                if (e == BreakException)
-                    break;
-                if (e == ContinueException)
-                    continue;
-                throw e;
-            }
-        }
-    }
-    
-    visitSwitchStatement(node)
-    {
-        let findAndRunCast = predicate => {
-            for (let i = 0; i < node.switchCases.length; ++i) {
-                let switchCase = node.switchCases[i];
-                if (predicate(switchCase)) {
-                    try {
-                        for (let j = i; j < node.switchCases.length; ++j)
-                            node.switchCases[j].visit(this);
-                    } catch (e) {
-                        if (e != BreakException)
-                            throw e;
-                    }
-                    return true;
-                }
-            }
-            return false;
-        };
-        
-        let value = node.value.visit(this).loadValue();
-        
-        let found = findAndRunCast(switchCase => {
-            if (switchCase.isDefault)
-                return false;
-            return node.type.unifyNode.valuesEqual(
-                value, switchCase.value.unifyNode.valueForSelectedType);
-        });
-        if (found)
-            return;
-        
-        found = findAndRunCast(switchCase => switchCase.isDefault);
-        if (!found)
-            throw new Error("Switch statement did not find case");
-    }
-
-    visitBreak(node)
-    {
-        throw BreakException;
-    }
-
-    visitContinue(node)
-    {
-        throw ContinueException;
-    }
-
-    visitTrapStatement(node)
-    {
-        throw new WTrapError(node.origin.originString, "Trap statement");
-    }
-    
-    visitAnonymousVariable(node)
-    {
-        node.type.populateDefaultValue(node.ePtr.buffer, node.ePtr.offset);
-    }
-    
-    visitCallExpression(node)
-    {
-        if (node.func instanceof NativeFunc) {
-            const callArguments = this._evaluateArguments(node.argumentList, node.func.parameters);
-            return EBuffer.allowAllocation(() => this._snapshot(node.func.returnType, node.resultEPtr, node.func.implementation(callArguments, node)));
-        } else
-            return this._evaluateFunction(node, node.argumentList, node.func.parameters, node.func.body, node.func.returnType, node.resultEPtr, false);
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/Expression.js b/Tools/WebGPUShadingLanguageRI/Expression.js
deleted file mode 100644 (file)
index 0d8de1c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Expression extends Value {
-    constructor(origin)
-    {
-        super();
-        this._origin = origin;
-    }
-    
-    get origin() { return this._origin; }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/ExpressionFinder.js b/Tools/WebGPUShadingLanguageRI/ExpressionFinder.js
deleted file mode 100644 (file)
index 984a543..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-// This finds type and value expressions, but skips type and value declarations.
-class ExpressionFinder extends Visitor {
-    constructor(callback)
-    {
-        super();
-        this._callback = callback;
-    }
-    
-    visitFunc(node)
-    {
-        this._callback(node.returnType);
-        for (let parameter of node.parameters)
-            parameter.visit(this);
-    }
-    
-    visitFuncParameter(node)
-    {
-        this._callback(node.type);
-    }
-    
-    visitAssignment(node)
-    {
-        this._callback(node);
-    }
-    
-    visitReadModifyWriteExpression(node)
-    {
-        this._callback(node);
-    }
-    
-    visitIdentityExpression(node)
-    {
-        this._callback(node);
-    }
-    
-    visitCallExpression(node)
-    {
-        this._callback(node);
-    }
-    
-    visitReturn(node)
-    {
-        if (node.value)
-            this._callback(node.value);
-    }
-    
-    visitWhileLoop(node)
-    {
-        this._callback(node.conditional);
-        node.body.visit(this);
-    }
-    
-    visitDoWhileLoop(node)
-    {
-        node.body.visit(this);
-        this._callback(node.conditional);
-    }
-    
-    visitIfStatement(node)
-    {
-        this._callback(node.conditional);
-        node.body.visit(this);
-        if (node.elseBody)
-            node.elseBody.visit(this);
-    }
-    
-    visitForLoop(node)
-    {
-        // Initialization is a statement, not an expression. If it's an assignment or variableDecl, we'll
-        // catch it and redirect to the callback.
-        if (node.initialization)
-            node.initialization.visit(this);
-        
-        if (node.condition)
-            this._callback(node.condition);
-        if (node.increment)
-            this._callback(node.increment);
-        
-        node.body.visit(this);
-    }
-    
-    visitVariableDecl(node)
-    {
-        this._callback(node.type);
-        if (node.initializer)
-            this._callback(node.initializer);
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/ExternalOrigin.js b/Tools/WebGPUShadingLanguageRI/ExternalOrigin.js
deleted file mode 100644 (file)
index 263659a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-const externalOrigin = {
-    originString: "<external>",
-    originKind: "user"
-};
diff --git a/Tools/WebGPUShadingLanguageRI/Field.js b/Tools/WebGPUShadingLanguageRI/Field.js
deleted file mode 100644 (file)
index 312b00d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class Field extends Node {
-    constructor(origin, name, type, semantic = null)
-    {
-        super();
-        this._origin = origin;
-        this._name = name;
-        this._type = type;
-        this._semantic = semantic;
-    }
-    
-    get origin() { return this._origin; }
-    get name() { return this._name; }
-    get type() { return this._type; }
-    get semantic() { return this._semantic; }
-    
-    toString()
-    {
-        let result = this.type + " " + this.name;
-        if (this.semantic)
-            result += ": " + this.semantic;
-        return result;
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/FindHighZombies.js b/Tools/WebGPUShadingLanguageRI/FindHighZombies.js
deleted file mode 100644 (file)
index 663c6d5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function findHighZombies(program)
-{
-    program.visit(new HighZombieFinder());
-}
diff --git a/Tools/WebGPUShadingLanguageRI/FlattenedStructOffsetGatherer.js b/Tools/WebGPUShadingLanguageRI/FlattenedStructOffsetGatherer.js
deleted file mode 100644 (file)
index 2739d7b..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class FlattenedStructOffsetGatherer extends Visitor {
-    constructor(initial)
-    {
-        super();
-        this._offset = 0;
-        this._name = [initial];
-        this._result = [];
-    }
-
-    get result()
-    {
-        return this._result;
-    }
-    
-    visitReferenceType(node)
-    {
-    }
-    
-    visitField(node)
-    {
-        this._offset += node.offset;
-        this._name.push(node.name);
-        super.visitField(node);
-        this._name.pop();
-        this._offset -= node.offset;
-    }
-    
-    visitNativeType(node)
-    {
-        this._result.push({name: this._name.join("."), offset: this._offset, type: node.name});
-        super.visitNativeType(node);
-    }
-    
-    visitTypeRef(node)
-    {
-        Node.visit(node.type, this);
-    }
-
-    visitVectorType(node)
-    {
-        const fieldNames = [ "x", "y", "z", "w" ];
-        for (let i = 0; i < node.numElementsValue; i++) {
-            this._result.push({
-                name: this._name.join(".") + "." + fieldNames[i],
-                offset: this._offset + i * node.elementType.size,
-                type: node.elementType.name
-            });
-        }
-    }
-
-    visitMatrixType(node)
-    {
-        const fieldNames = [ "row0", "row1", "row2", "row3" ];
-        for (let i = 0; i < node.numRowsValue; i++) {
-            this._result.push({
-                name: this._name.join(".") + "." + fieldNames[i],
-                offset: this._offset + i * node.elementType.size * node.numColumnsValue,
-                type: node.elementType.name + node.numColumnsValue.toString()
-            });
-        }
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/FloatLiteral.js b/Tools/WebGPUShadingLanguageRI/FloatLiteral.js
deleted file mode 100644 (file)
index e6c5737..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-let FloatLiteral = createLiteral({
-    literalClassName: "FloatLiteral",
-    preferredTypeName: "float",
-    
-    negConstexpr(origin)
-    {
-        return new IntLiteral(origin, -this.value);
-    },
-    
-    createType(origin, value)
-    {
-        return new FloatLiteralType(origin, value);
-    }
-});
-
diff --git a/Tools/WebGPUShadingLanguageRI/FloatLiteralType.js b/Tools/WebGPUShadingLanguageRI/FloatLiteralType.js
deleted file mode 100644 (file)
index f7bb7f2..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-let FloatLiteralType = createLiteralType({
-    preferredTypeName: "float",
-    
-    verifyAsArgument(unificationContext)
-    {
-        let realThis = unificationContext.find(this);
-        if (!realThis.isFloating)
-            return {result: false, reason: "Cannot use float literal with non-floating type " + realThis};
-        if (!realThis.canRepresent(this.value))
-            return {result: false, reason: "Float literal " + this.value + " does not fit in type " + realThis};
-        return {result: true};
-    }
-});
diff --git a/Tools/WebGPUShadingLanguageRI/FoldConstexprs.js b/Tools/WebGPUShadingLanguageRI/FoldConstexprs.js
deleted file mode 100644 (file)
index 1107a78..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function foldConstexprs(program)
-{
-    program.visit(new ConstexprFolder());
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/ForLoop.js b/Tools/WebGPUShadingLanguageRI/ForLoop.js
deleted file mode 100644 (file)
index ede2917..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class ForLoop extends Node {
-    constructor(origin, initialization, condition, increment, body)
-    {
-        super();
-        this._origin = origin;
-        this._initialization = initialization;
-        this._condition = condition;
-        this._increment = increment;
-        this._body = body;
-    }
-
-    get origin() { return this._origin; }
-    get initialization() { return this._initialization; }
-    get condition() { return this._condition; }
-    get increment() { return this._increment; }
-    get body() { return this._body; }
-
-    toString()
-    {
-        return "for (" + (this.initialization ? this.initialization : " ") + "; " + (this.condition ? this.condition : "") + "; " + (this.increment ? this.increment : "") + ") " + this.body;
-    }
-};
-
diff --git a/Tools/WebGPUShadingLanguageRI/Func.js b/Tools/WebGPUShadingLanguageRI/Func.js
deleted file mode 100644 (file)
index e06b438..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Func extends Node {
-    constructor(origin, name, returnType, parameters, isCast, shaderType = null, semantic = null, attributeBlock = null)
-    {
-        if (!(origin instanceof LexerToken))
-            throw new Error("Bad origin: " + origin);
-        for (let parameter of parameters) {
-            if (!parameter)
-                throw new Error("Null parameter");
-            if (!parameter.type)
-                throw new Error("Null parameter type");
-        }
-        super();
-        this._origin = origin;
-        this._name = name;
-        this._returnType = returnType;
-        this._parameters = parameters;
-        this._isCast = isCast;
-        this._shaderType = shaderType;
-        this._semantic = semantic;
-        this._attributeBlock = attributeBlock;
-    }
-    
-    get origin() { return this._origin; }
-    get name() { return this._name; }
-    get returnType() { return this._returnType; }
-    get parameters() { return this._parameters; }
-    get parameterTypes() { return this.parameters.map(parameter => parameter.type); }
-    get isCast() { return this._isCast; }
-    get shaderType() { return this._shaderType; }
-    get semantic() { return this._semantic; }
-    get attributeBlock() { return this._attributeBlock; }
-    get isEntryPoint() { return this.shaderType != null; }
-    get returnTypeForOverloadResolution() { return this.isCast ? this.returnType : null; }
-    
-    set parameters(newValue)
-    {
-        this._parameters = newValue;
-    }
-
-    get kind() { return Func; }
-    
-    toDeclString()
-    {
-        let result = "";
-        if (this.shaderType)
-            result += this.shaderType + " ";
-        if (this.isCast)
-            result += `operator ${this.returnType}`;
-        else
-            result += `${this.returnType} ${this.name}`;
-        result += "(" + this.parameters + ")";
-        if (this.semantic)
-            result += ": " + this.semantic;
-        return result;
-    }
-    
-    toString()
-    {
-        return this.toDeclString();
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/FuncAttribute.js b/Tools/WebGPUShadingLanguageRI/FuncAttribute.js
deleted file mode 100644 (file)
index e2e267e..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class FuncAttribute extends Node {
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/FuncDef.js b/Tools/WebGPUShadingLanguageRI/FuncDef.js
deleted file mode 100644 (file)
index ef34ce4..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class FuncDef extends Func {
-    constructor(origin, name, returnType, parameters, body, isCast, shaderType = "", semantic = null, attributeBlock = null)
-    {
-        super(origin, name, returnType, parameters, isCast, shaderType, semantic, attributeBlock);
-        this._body = body;
-        this.isRestricted = false;
-    }
-
-    get body() { return this._body; }
-
-    set body(newBody)
-    {
-        this._body = newBody;
-    }
-
-    rewrite(rewriter)
-    {
-        this._returnType = this._returnType.visit(rewriter);
-        this._parameters = this._parameters.map(parameter => parameter.visit(rewriter));
-        this._body = this.body.visit(rewriter);
-    }
-    
-    toString()
-    {
-        return super.toString() + " " + this.body;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/FuncNumThreadsAttribute.js b/Tools/WebGPUShadingLanguageRI/FuncNumThreadsAttribute.js
deleted file mode 100644 (file)
index 6abe344..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class FuncNumThreadsAttribute extends FuncAttribute {
-    constructor(x, y, z)
-    {
-        super();
-        this._x = x;
-        this._y = y;
-        this._z = z;
-    }
-
-    get x() { return this._x; }
-    get y() { return this._y; }
-    get z() { return this._z; }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/FuncParameter.js b/Tools/WebGPUShadingLanguageRI/FuncParameter.js
deleted file mode 100644 (file)
index 05cdb52..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-class FuncParameter extends Value {
-    // The name is optional. It's OK for it to be null!
-    constructor(origin, name, type, semantic = null)
-    {
-        super();
-        this._origin = origin;
-        this._name = name;
-        this._type = type;
-        this._semantic = semantic;
-    }
-    
-    get origin() { return this._origin; }
-    get name() { return this._name; }
-    get type() { return this._type; }
-    get semantic() { return this._semantic; }
-    get varIsLValue() { return true; }
-    
-    toString()
-    {
-        let result;
-        if (!this.name)
-            result = "" + this.type;
-        else
-            result = this.type + " " + this.name;
-        if (this.semantic)
-            result += ": " + this.semantic;
-        return result;
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/FunctionLikeBlock.js b/Tools/WebGPUShadingLanguageRI/FunctionLikeBlock.js
deleted file mode 100644 (file)
index 40f995e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class FunctionLikeBlock extends Value {
-    constructor(origin, func, argumentList)
-    {
-        super();
-        this._origin = origin;
-        this._func = func;
-        this._argumentList = argumentList;
-    }
-    
-    get origin() { return this._origin; }
-    get func() { return this._func; }
-    get returnType() { return this.func._returnType; }
-    get argumentList() { return this._argumentList; }
-    get parameters() { return this.func._parameters; }
-    get body() { return this.func._body; }
-    
-    toString()
-    {
-        return "([&] (" + this.parameters + ") -> " + this.returnType + " { " + this.body + " }(" + this.argumentList + "))";
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/HighZombieFinder.js b/Tools/WebGPUShadingLanguageRI/HighZombieFinder.js
deleted file mode 100644 (file)
index caeee15..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-// If a high-level construct somehow manages to live on when we're lowered, it's a high zombie.
-class HighZombieFinder extends Visitor {
-    _found(node)
-    {
-        throw new Error(node.origin.originString + ": High zombie: " + node);
-    }
-    
-    visitDotExpression(node)
-    {
-        this._found(node);
-    }
-    
-    visitIndexExpression(node)
-    {
-        this._found(node);
-    }
-    
-    visitCallExpression(node)
-    {
-        super.visitCallExpression(node);
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/IdentityExpression.js b/Tools/WebGPUShadingLanguageRI/IdentityExpression.js
deleted file mode 100644 (file)
index f0ce6a3..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class IdentityExpression extends Expression {
-    constructor(target)
-    {
-        super(target.origin);
-        this._target = target;
-    }
-    
-    get target() { return this._target; }
-    
-    get unifyNode() { return this.target.unifyNode; }
-    get isConstexpr() { return this.target.isConstexpr; }
-    get isLValue() { return this.target.isLValue; }
-    get addressSpace() { return this.target.addressSpace; }
-    
-    toString()
-    {
-        return "(" + this.target + ")";
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/IfStatement.js b/Tools/WebGPUShadingLanguageRI/IfStatement.js
deleted file mode 100644 (file)
index 76de5f9..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class IfStatement extends Node {
-    constructor(origin, conditional, body, elseBody)
-    {
-        super();
-        this._origin = origin;
-        this._conditional = conditional;
-        this._body = body;
-        this._elseBody = elseBody;
-    }
-
-    get origin() { return this._origin; }
-    get conditional() { return this._conditional; }
-    get body() { return this._body; }
-    get elseBody() { return this._elseBody; }
-
-    toString()
-    {
-        let result = "if (" + this.conditional + ") " + this.body;
-        if (this.elseBody)
-            return result + " else " + this.elseBody;
-        return result;
-    }
-};
-
diff --git a/Tools/WebGPUShadingLanguageRI/IndexExpression.js b/Tools/WebGPUShadingLanguageRI/IndexExpression.js
deleted file mode 100644 (file)
index b0b7f91..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class IndexExpression extends PropertyAccessExpression {
-    constructor(origin, array, index)
-    {
-        super(origin, array);
-        this._index = index;
-    }
-    
-    get array() { return this.base; }
-    get index() { return this._index; }
-    
-    get getFuncName() { return "operator[]"; }
-    get andFuncName() { return "operator&[]"; }
-    get setFuncName() { return "operator[]="; }
-
-    updateCalls()
-    {
-        if (this.callForGet)
-            this.callForGet.argumentList[1] = this.index;
-        if (this.callForAnd)
-            this.callForAnd.argumentList[1] = this.index;
-        if (this.callForSet)
-            this.callForSet.argumentList[1] = this.index;
-        super.updateCalls();
-    }
-
-    toString()
-    {
-        return "(" + this.array + "[" + this.index + "])";
-    }
-}
diff --git a/Tools/WebGPUShadingLanguageRI/InferTypesForCall.js b/Tools/WebGPUShadingLanguageRI/InferTypesForCall.js
deleted file mode 100644 (file)
index bcfeb98..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-"use strict";
-
-function inferTypesForCall(func, argumentTypes, returnType)
-{
-    if (argumentTypes.length != func.parameters.length)
-        return {failure: new OverloadResolutionFailure(func, "Wrong number of arguments (passed " + argumentTypes.length + ", require " + func.parameters.length + ")")};
-    let unificationContext = new UnificationContext();
-
-    for (let i = 0; i < argumentTypes.length; ++i) {
-        if (!argumentTypes[i])
-            throw new Error("Null argument type at i = " + i);
-        if (!argumentTypes[i].unify(unificationContext, func.parameters[i].type))
-            return {failure: new OverloadResolutionFailure(func, "Argument #" + (i + 1) + " " + (func.parameters[i].name ? "for parameter " + func.parameters[i].name + " " : "") + "does not match (passed " + argumentTypes[i] + ", require " + func.parameters[i].type + ")")};
-    }
-    if (returnType && !returnType.unify(unificationContext, func.returnType))
-        return {failure: new OverloadResolutionFailure(func, "Return type " + func.returnType + " does not match " + returnType)};
-    let verificationResult = unificationContext.verify();
-    if (!verificationResult.result)
-        return {failure: new OverloadResolutionFailure(func, verificationResult.reason)};
-
-    return {func, unificationContext};
-}
-
-function inferTypesForTypeArguments(type, typeArguments)
-{
-    if (typeArguments.length != type.typeArguments.length)
-        return {failure: new TypeOverloadResolutionFailure(type, "Wrong number of arguments (passed " + typeArguments.length + ", require " + type.typeArguments.length + ")")};
-    let unificationContext = new UnificationContext();
-
-    for (let i = 0; i < typeArguments.length; ++i) {
-        if (!typeArguments[i])
-            throw new Error("Null type argument at i = " + i);
-        if (!typeArguments[i].unify(unificationContext, type.typeArguments[i]))
-            return {failure: new TypeOverloadResolutionFailure(type, "Argument #" + (i + 1) + " " + (type.typeArguments[i].name ? "for parameter " + type.typeArguments[i].name + " " : "") + "does not match (passed " + typeArguments[i] + ", require " + type.typeArguments[i].type + ")")};
-    }
-    let verificationResult = unificationContext.verify();
-    if (!verificationResult.result)
-        return {failure: new TypeOverloadResolutionFailure(type, verificationResult.reason)};
-
-    return {type, unificationContext};
-}
diff --git a/Tools/WebGPUShadingLanguageRI/Inline.js b/Tools/WebGPUShadingLanguageRI/Inline.js
deleted file mode 100644 (file)
index d35881c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-function inline(program)
-{
-    for (let funcList of program.functions.values()) {
-        for (let func of funcList)
-            _inlineFunction(program, func, new VisitingSet(func));
-    }
-}
-
-function _inlineFunction(program, func, visiting)
-{
-    if (func.inlined || func.isNative)
-        return;
-    func.rewrite(new Inliner(program, func, visiting));
-    func.inlined = true;
-}
diff --git a/Tools/WebGPUShadingLanguageRI/Inliner.js b/Tools/WebGPUShadingLanguageRI/Inliner.js
deleted file mode 100644 (file)
index 56c40df..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Inliner extends Rewriter {
-    constructor(program, func, visiting)
-    {
-        super();
-        this._program = program;
-        this._visiting = visiting;
-    }
-    
-    visitCallExpression(node)
-    {
-        let result = super.visitCallExpression(node);
-        if (result.func.isNative)
-            return result;
-        return this._visiting.doVisit(result.func, () => {
-            let func = result.func;
-            if (func.isNative)
-                throw new Error("Unexpected native func: " + func);
-            _inlineFunction(this._program, func, this._visiting);
-            let resultingBlock = new FunctionLikeBlock(result.origin, func, result.argumentList);
-            resultingBlock.returnEPtr = result.resultEPtr;
-            return resultingBlock;
-        });
-    }
-}
-
diff --git a/Tools/WebGPUShadingLanguageRI/IntLiteral.js b/Tools/WebGPUShadingLanguageRI/IntLiteral.js
deleted file mode 100644 (file)
index 022b343..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-let IntLiteral = createLiteral({
-    literalClassName: "IntLiteral",
-    preferredTypeName: "int",
-    
-    negConstexpr(origin)
-    {
-        return new IntLiteral(origin, (-this.value) | 0);
-    },
-    
-    createType(origin, value)
-    {
-        return new IntLiteralType(origin, value);
-    }
-});
-
diff --git a/Tools/WebGPUShadingLanguageRI/IntLiteralType.js b/Tools/WebGPUShadingLanguageRI/IntLiteralType.js
deleted file mode 100644 (file)
index 7cd9dd7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-let IntLiteralType = createLiteralType({
-    preferredTypeName: "int",
-    
-    verifyAsArgument(unificationContext)
-    {
-        let realThis = unificationContext.find(this);
-        if (!realThis.isNumber)
-            return {result: false, reason: "Cannot use int literal with non-number type " + realThis};
-        if (!realThis.canRepresent(this.value))
-            return {result: false, reason: "Int literal " + this.value + " too large to be represented by type " + realThis};
-        return {result: true};
-    }
-});
diff --git a/Tools/WebGPUShadingLanguageRI/Intrinsics.js b/Tools/WebGPUShadingLanguageRI/Intrinsics.js
deleted file mode 100644 (file)
index 6d8c37e..0000000
+++ /dev/null
@@ -1,2655 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-"use strict";
-
-class Intrinsics {
-    constructor(nameContext)
-    {
-        this._map = new Map();
-
-        // NOTE: Intrinsic resolution happens before type name resolution, so the strings we use here
-        // to catch the intrinsics must be based on the type names that StandardLibrary.js uses.
-        // For example, if a native function is declared using "int" rather than "int", then we must
-        // use "int" here, since we don't yet know that they are the same type.
-
-        this._map.set(
-            "native typedef void",
-            type => {
-                this.void = type;
-                type.size = 0;
-                type.populateDefaultValue = () => { };
-            });
-
-        this._map.set(
-            "native typedef bool",
-            type => {
-                this.bool = type;
-                type.isPrimitive = true;
-                type.size = 1;
-                type.populateDefaultValue = (buffer, offset) => buffer.set(offset, false);
-            });
-
-        this._map.set(
-            "native typedef uchar",
-            type => {
-                this.uchar = type;
-                type.isPrimitive = true;
-                type.isInt = true;
-                type.isNumber = true;
-                type.isSigned = false;
-                type.canRepresent = value => isBitwiseEquivalent(castToUchar(value), value);
-                type.size = 1;
-                type.defaultValue = 0;
-                type.createLiteral = (origin, value) => IntLiteral.withType(origin, castToUchar(value), type);
-                type.successorValue = value => castToUchar(value + 1);
-                type.valuesEqual = (a, b) => a === b;
-                type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                type.formatValueFromIntLiteral = value => castToUchar(value);
-                type.formatValueFromUintLiteral = value => castToUchar(value);
-                type.allValues = function*() {
-                    for (let i = 0; i <= 0xff; ++i)
-                        yield {value: i, name: i};
-                };
-            });
-
-
-            this._map.set(
-             "native typedef ushort",
-             type => {
-                 this.ushort = type;
-                 type.isPrimitive = true;
-                 type.isInt = true;
-                 type.isNumber = true;
-                 type.isSigned = false;
-                 type.canRepresent = value => isBitwiseEquivalent(castToUshort(value), value);
-                 type.size = 1;
-                 type.defaultValue = 0;
-                 type.createLiteral = (origin, value) => IntLiteral.withType(origin, castToUshort(value), type);
-                 type.successorValue = value => castToUshort(value + 1);
-                 type.valuesEqual = (a, b) => a === b;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                 type.formatValueFromIntLiteral = value => castToUshort(value);
-                 type.formatValueFromUintLiteral = value => castToUshort(value);
-                 type.allValues = function*() {
-                     for (let i = 0; i <= 0xffff; ++i)
-                         yield {value: i, name: i};
-                 };
-             });
-
-        this._map.set(
-             "native typedef uint",
-             type => {
-                 this.uint = type;
-                 type.isPrimitive = true;
-                 type.isInt = true;
-                 type.isNumber = true;
-                 type.isSigned = false;
-                 type.canRepresent = value => isBitwiseEquivalent(castToUint(value), value);
-                 type.size = 1;
-                 type.defaultValue = 0;
-                 type.createLiteral = (origin, value) => IntLiteral.withType(origin, castToUint(value), type);
-                 type.successorValue = value => castToUint(value + 1);
-                 type.valuesEqual = (a, b) => a === b;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                 type.formatValueFromIntLiteral = value => castToUint(value);
-                 type.formatValueFromUintLiteral = value => castToUint(value);
-                 type.allValues = function*() {
-                     for (let i = 0; i <= 0xffffffff; ++i)
-                         yield {value: i, name: i};
-                 };
-             });
-
-        this._map.set(
-             "native typedef char",
-             type => {
-                 this.char = type;
-                 type.isPrimitive = true;
-                 type.isInt = true;
-                 type.isNumber = true;
-                 type.isSigned = true;
-                 type.canRepresent = value => isBitwiseEquivalent(castToChar(value), value);
-                 type.size = 1;
-                 type.defaultValue = 0;
-                 type.createLiteral = (origin, value) => IntLiteral.withType(origin, castToChar(value), type);
-                 type.successorValue = value => castToChar(value + 1);
-                 type.valuesEqual = (a, b) => a === b;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                 type.formatValueFromIntLiteral = value => castToChar(value);
-                 type.formatValueFromUintLiteral = value => castToChar(value);
-                 type.allValues = function*() {
-                     for (let i = 0; i <= 0xff; ++i) {
-                         let value = castToChar(i);
-                         yield {value: value, name: value};
-                     }
-                 };
-             });
-
-        this._map.set(
-             "native typedef short",
-             type => {
-                 this.short = type;
-                 type.isPrimitive = true;
-                 type.isInt = true;
-                 type.isNumber = true;
-                 type.isSigned = true;
-                 type.canRepresent = value => isBitwiseEquivalent(castToShort(value), value);
-                 type.size = 1;
-                 type.defaultValue = 0;
-                 type.createLiteral = (origin, value) => IntLiteral.withType(origin, castToShort(value), type);
-                 type.successorValue = value => castToShort(value + 1);
-                 type.valuesEqual = (a, b) => a === b;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                 type.formatValueFromIntLiteral = value => castToShort(value);
-                 type.formatValueFromUintLiteral = value => castToShort(value);
-                 type.allValues = function*() {
-                     for (let i = 0; i <= 0xffff; ++i) {
-                         let value = castToShort(i);
-                         yield {value: value, name: value};
-                     }
-                 };
-             });
-
-        this._map.set(
-             "native typedef int",
-             type => {
-                 this.int = type;
-                 type.isPrimitive = true;
-                 type.isInt = true;
-                 type.isNumber = true;
-                 type.isSigned = true;
-                 type.canRepresent = value => isBitwiseEquivalent(castToInt(value), value);
-                 type.size = 1;
-                 type.defaultValue = 0;
-                 type.createLiteral = (origin, value) => IntLiteral.withType(origin, castToInt(value), type);
-                 type.successorValue = value => castToInt(value + 1);
-                 type.valuesEqual = (a, b) => a === b;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                 type.formatValueFromIntLiteral = value => castToInt(value);
-                 type.formatValueFromUintLiteral = value => castToInt(value);
-                 type.allValues = function*() {
-                     for (let i = 0; i <= 0xffffffff; ++i) {
-                         let value = castToInt(i);
-                         yield {value: value, name: value};
-                     }
-                 };
-             });
-
-         this._map.set(
-             "native typedef half",
-             type => {
-                 this.half = type;
-                 type.isPrimitive = true;
-                 type.size = 1;
-                 type.isFloating = true;
-                 type.isNumber = true;
-                 type.canRepresent = value => true;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                 type.formatValueFromIntLiteral = value => value;
-                 type.formatValueFromUintLiteral = value => value;
-                 type.formatValueFromFloatLiteral = value => castToHalf(value);
-             });
-
-         this._map.set(
-             "native typedef float",
-             type => {
-                 this.float = type;
-                 type.isPrimitive = true;
-                 type.size = 1;
-                 type.isFloating = true;
-                 type.isNumber = true;
-                 type.canRepresent = value => true;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-                 type.formatValueFromIntLiteral = value => value;
-                 type.formatValueFromUintLiteral = value => value;
-                 type.formatValueFromFloatLiteral = value => castToFloat(value);
-             });
-
-        this._map.set(
-             "native typedef atomic_int",
-             type => {
-                 this.atomic_int = type;
-                 type.size = 1;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-             });
-
-        this._map.set(
-             "native typedef atomic_uint",
-             type => {
-                 this.atomic_uint = type;
-                 type.size = 1;
-                 type.populateDefaultValue = (buffer, offset) => buffer.set(offset, 0);
-             });
-
-        for (let vectorType of VectorElementTypes) {
-            for (let vectorSize of VectorElementSizes) {
-                this._map.set(`native typedef vector<${vectorType}, ${vectorSize}>`, type => {
-                    this[`vector<${vectorType}, ${vectorSize}>`] = type;
-                    type.isPrimitive = true;
-                });
-            }
-        }
-
-        for (let typeName of ["half", "float"]) {
-            for (let height = 2; height <= 4; ++height) {
-                for (let width = 2; width <= 4; ++width) {
-                    this._map.set(`native typedef matrix<${typeName}, ${height}, ${width}>`, type => {
-                        this[`matrix<${typeName}, ${height}, ${width}>`] = type;
-                    });
-                }
-            }
-        }
-
-        this._map.set(
-            "native typedef sampler",
-            type => {
-                this.sampler = type;
-                type.size = 1;
-                type.populateDefaultValue = (buffer, offset) => buffer.set(offset, {});
-            });
-
-        for (let textureType of ["Texture1D", "RWTexture1D", "Texture1DArray", "RWTexture1DArray", "Texture2D", "RWTexture2D", "Texture2DArray", "RWTexture2DArray", "Texture3D", "RWTexture3D", "TextureCube"]) {
-            for (let typeArgument of ["bool", "uchar", "ushort", "uint", "char", "short", "int", "half", "float"]) {
-                this._map.set(
-                    `native typedef ${textureType}<${typeArgument}>`,
-                    type => {
-                        this[`${textureType}<${typeArgument}>`] = type;
-                        type.size = 1;
-                        type.isTexture = true;
-                        type.populateDefaultValue = (buffer, offset) => buffer.set(offset, {});
-                    });
-                for (let i = 2; i <= 4; ++i) {
-                    this._map.set(
-                        `native typedef ${textureType}<${typeArgument}${i}>`,
-                        type => {
-                            this[`${textureType}<${typeArgument}${i}>`] = type;
-                            type.size = 1;
-                            type.isTexture = true;
-                            type.populateDefaultValue = (buffer, offset) => buffer.set(offset, {});
-                        });
-                }
-            }
-        }
-
-        for (let textureType of ["TextureDepth2D", "RWTextureDepth2D", "TextureDepth2DArray", "RWTextureDepth2DArray", "TextureDepthCube"]) {
-            for (let typeArgument of ["float", "half"]) {
-                this._map.set(
-                    `native typedef ${textureType}<${typeArgument}>`,
-                    type => {
-                        this[`${textureType}<${typeArgument}>`] = type;
-                        type.size = 1;
-                        type.populateDefaultValue = (buffer, offset) => buffer.set(offset, {});
-                    });
-            }
-        }
-
-        for (let primitiveType of ["ushort", "uint", "char", "short", "int", "half", "float"]) {
-            this._map.set(
-                `native operator uchar(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(castToUchar(value.loadValue()));
-                });
-        }
-
-        for (let primitiveType of ["uchar", "uint", "char", "short", "int", "half", "float"]) {
-            this._map.set(
-                `native operator ushort(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(castToUshort(value.loadValue()));
-                });
-        }
-
-        for (let primitiveType of ["uchar", "ushort", "char", "short", "int", "half", "float"]) {
-            this._map.set(
-                `native operator uint(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(castToUint(value.loadValue()));
-                });
-        }
-
-        for (let primitiveType of ["uchar", "ushort", "uint", "short", "int", "half", "float"]) {
-            this._map.set(
-                `native operator char(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(castToChar(value.loadValue()));
-                });
-        }
-
-        for (let primitiveType of ["uchar", "ushort", "uint", "char", "int", "half", "float"]) {
-            this._map.set(
-                `native operator short(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(castToShort(value.loadValue()));
-                });
-        }
-
-        for (let primitiveType of ["uchar", "ushort", "uint", "char", "short", "half", "float"]) {
-            this._map.set(
-                `native operator int(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(cast(Int32Array, value.loadValue()));
-                });
-        }
-
-        for (let primitiveType of ["uchar", "ushort", "uint", "char", "short", "int", "float"]) {
-            this._map.set(
-                `native operator half(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(castToHalf(value.loadValue()));
-                });
-        }
-
-        for (let primitiveType of ["uchar", "ushort", "uint", "char", "short", "int", "half"]) {
-            this._map.set(
-                `native operator float(${primitiveType})`,
-                func => {
-                    func.implementation = ([value]) => EPtr.box(castToFloat(value.loadValue()));
-                });
-        }
-
-        this._map.set(
-            `native operator int(atomic_int)`,
-            func => {
-                func.implementation = ([value]) => EPtr.box(value.loadValue());
-            });
-
-        this._map.set(
-            `native operator uint(atomic_uint)`,
-            func => {
-                func.implementation = ([value]) => EPtr.box(value.loadValue());
-            });
-
-        this._map.set(
-            "native bool operator==(bool,bool)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(left.loadValue() == right.loadValue());
-            });
-
-        for (let primitiveType of ["uint", "int", "float"]) {
-            this._map.set(
-                `native bool operator==(${primitiveType},${primitiveType})`,
-                func => {
-                    func.implementation = ([left, right]) =>
-                        EPtr.box(left.loadValue() == right.loadValue());
-                });
-
-            this._map.set(
-                `native bool operator<(${primitiveType},${primitiveType})`,
-                func => {
-                    func.implementation = ([left, right]) =>
-                        EPtr.box(left.loadValue() < right.loadValue());
-                });
-
-            this._map.set(
-                `native bool operator<=(${primitiveType},${primitiveType})`,
-                func => {
-                    func.implementation = ([left, right]) =>
-                        EPtr.box(left.loadValue() <= right.loadValue());
-                });
-
-            this._map.set(
-                `native bool operator>(${primitiveType},${primitiveType})`,
-                func => {
-                    func.implementation = ([left, right]) =>
-                        EPtr.box(left.loadValue() > right.loadValue());
-                });
-
-            this._map.set(
-                `native bool operator>=(${primitiveType},${primitiveType})`,
-                func => {
-                    func.implementation = ([left, right]) =>
-                        EPtr.box(left.loadValue() >= right.loadValue());
-                });
-        }
-
-        this._map.set(
-            "native int operator-(int)",
-            func => {
-                func.implementation = ([value]) =>
-                    EPtr.box(castToInt(-value.loadValue()));
-            });
-
-        this._map.set(
-            "native float operator-(float)",
-            func => {
-                func.implementation = ([value]) =>
-                    EPtr.box(castToFloat(-value.loadValue()));
-            });
-
-        this._map.set(
-            "native int operator+(int,int)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToInt(left.loadValue() + right.loadValue()));
-            });
-
-        this._map.set(
-            "native int operator-(int,int)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToInt(left.loadValue() - right.loadValue()));
-            });
-
-        this._map.set(
-            "native int operator*(int,int)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToInt(left.loadValue() * right.loadValue()));
-            });
-
-        this._map.set(
-            "native int operator/(int,int)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToInt(left.loadValue() / right.loadValue()));
-            });
-
-        this._map.set(
-            "native uint operator+(uint,uint)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToUint(left.loadValue() + right.loadValue()));
-            });
-
-        this._map.set(
-            "native uint operator-(uint,uint)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToUint(left.loadValue() - right.loadValue()));
-            });
-
-        this._map.set(
-            "native uint operator*(uint,uint)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToUint(left.loadValue() * right.loadValue()));
-            });
-
-        this._map.set(
-            "native uint operator/(uint,uint)",
-            func => {
-                func.implementation = ([left, right]) =>
-                    EPtr.box(castToUint(left.loadValue() / right.loadValue()));
-          &n