WebKit Bugzilla
Attachment 359017 Details for
Bug 193389
: [WHLSL] Assorted cleanup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193389-20190113193601.patch (text/plain), 108.58 KB, created by
Myles C. Maxfield
on 2019-01-13 19:36:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2019-01-13 19:36:20 PST
Size:
108.58 KB
patch
obsolete
>Subversion Revision: 239912 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6610998eaf2b9fa0c9eed0396055348f538b73d5..dbab4372c6b96ba66f321094c48a98eee84386da 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,163 @@ >+2019-01-13 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [WHLSL] Assorted cleanup >+ https://bugs.webkit.org/show_bug.cgi?id=193389 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This is a bunch of non-behavior-changing cleanup. >+ >+ - The compiler uses UniqueRef all over the place, and UniqueRef has an implicit operator T&. Therefore, >+ we don't need to static_cast<T&> everywhere. >+ - ConstantExpressionEnumerationMemberReference is the exact same thing as EnumerationMemberLiteral, so >+ this patch deletes the longer-named class in favor of the shorter-named class. >+ - Because of the header dependency tree, this patch moves EntryPointType into its own file so it can be >+ used by files that FunctionDeclaration depends on. Same thing for AddressSpace. >+ - EnumTypes have to have non-null base types. The parser will make sure this is always true. >+ >+ No new tests because there is no behavior change. >+ >+ * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h. >+ * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: >+ (WebCore::WHLSL::AST::ArrayType::type const): >+ (WebCore::WHLSL::AST::ArrayType::type): >+ * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: >+ (WebCore::WHLSL::AST::AssignmentExpression::left): >+ (WebCore::WHLSL::AST::AssignmentExpression::right): >+ * Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: >+ * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: >+ (WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const): >+ * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: >+ * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: >+ (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression): >+ (WebCore::WHLSL::AST::ConstantExpression::clone const): >+ (WebCore::WHLSL::AST::ConstantExpression::matches const): >+ * Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Removed. >+ * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: >+ (WebCore::WHLSL::AST::DereferenceExpression::pointer): >+ * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: >+ (WebCore::WHLSL::AST::DoWhileLoop::body): >+ (WebCore::WHLSL::AST::DoWhileLoop::conditional): >+ * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: >+ (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression): >+ * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h. >+ * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: >+ (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition): >+ (WebCore::WHLSL::AST::EnumerationDefinition::type): >+ * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::left const): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::right const): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const): >+ (WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember): >+ * Modules/webgpu/WHLSL/AST/WHLSLExpression.h: >+ (WebCore::WHLSL::AST::Expression::type): >+ (WebCore::WHLSL::AST::Expression::setType): >+ (WebCore::WHLSL::AST::Expression::addressSpace const): >+ (WebCore::WHLSL::AST::Expression::setAddressSpace): >+ * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: >+ (WebCore::WHLSL::AST::FloatLiteralType::conversionCost const): >+ * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: >+ (WebCore::WHLSL::AST::FloatLiteralType::preferredType): >+ * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: >+ (WebCore::WHLSL::AST::ForLoop::condition): >+ (WebCore::WHLSL::AST::ForLoop::increment): >+ (WebCore::WHLSL::AST::ForLoop::body): >+ * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: >+ (WebCore::WHLSL::AST::FunctionDeclaration::type const): >+ (WebCore::WHLSL::AST::FunctionDeclaration::type): >+ * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: >+ (WebCore::WHLSL::AST::IfStatement::conditional): >+ (WebCore::WHLSL::AST::IfStatement::body): >+ (WebCore::WHLSL::AST::IfStatement::elseBody): >+ * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: >+ (WebCore::WHLSL::AST::IndexExpression::indexExpression): >+ * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: >+ (WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const): >+ * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: >+ (WebCore::WHLSL::AST::IntegerLiteralType::preferredType): >+ * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: >+ (WebCore::WHLSL::AST::LogicalExpression::left): >+ (WebCore::WHLSL::AST::LogicalExpression::right): >+ * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: >+ (WebCore::WHLSL::AST::LogicalNotExpression::operand): >+ * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: >+ (WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue): >+ * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: >+ (WebCore::WHLSL::AST::MakePointerExpression::lValue): >+ * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: >+ (WebCore::WHLSL::AST::PropertyAccessExpression::base): >+ * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: >+ (WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue): >+ (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression): >+ (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression): >+ * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: >+ (WebCore::WHLSL::AST::ReferenceType::elementType const): >+ (WebCore::WHLSL::AST::ReferenceType::elementType): >+ * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: >+ (WebCore::WHLSL::AST::ResolvableType::resolvedType const): >+ (WebCore::WHLSL::AST::ResolvableType::resolvedType): >+ * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: >+ (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const): >+ (WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const): >+ * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: >+ * Modules/webgpu/WHLSL/AST/WHLSLReturn.h: >+ (WebCore::WHLSL::AST::Return::value): >+ * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: >+ (WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const): >+ * Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: >+ * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: >+ (WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const): >+ * Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: >+ * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: >+ (WebCore::WHLSL::AST::StructureElement::type): >+ * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: >+ (WebCore::WHLSL::AST::SwitchStatement::value): >+ * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: >+ (WebCore::WHLSL::AST::TernaryExpression::predicate): >+ (WebCore::WHLSL::AST::TernaryExpression::bodyExpression): >+ (WebCore::WHLSL::AST::TernaryExpression::elseExpression): >+ * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: >+ (WebCore::WHLSL::AST::TypeDefinition::type): >+ * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: >+ (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const): >+ * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: >+ (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType): >+ * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: >+ (WebCore::WHLSL::AST::VariableDeclaration::type): >+ (WebCore::WHLSL::AST::VariableDeclaration::initializer): >+ (WebCore::WHLSL::AST::VariableDeclaration::isAnonymous const): >+ * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: >+ (WebCore::WHLSL::AST::WhileLoop::conditional): >+ (WebCore::WHLSL::AST::WhileLoop::body): >+ * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: >+ (WebCore::WHLSL::checkDuplicateFunctions): >+ * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: >+ (WebCore::WHLSL::commit): >+ (WebCore::WHLSL::inferTypesForTypeArguments): >+ (WebCore::WHLSL::inferTypesForCall): >+ * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: >+ (WebCore::WHLSL::NameResolver::visit): >+ (WebCore::WHLSL::resolveNamesInTypes): >+ (WebCore::WHLSL::resolveNamesInFunctions): >+ * Modules/webgpu/WHLSL/WHLSLNameResolver.h: >+ * Modules/webgpu/WHLSL/WHLSLParser.h: >+ * Modules/webgpu/WHLSL/WHLSLProgram.h: >+ (WebCore::WHLSL::Program::append): >+ * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: >+ (WebCore::WHLSL::synthesizeEnumerationFunctions): >+ * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: >+ (WebCore::WHLSL::synthesizeStructureAccessors): >+ * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: >+ (WebCore::WHLSL::Visitor::visit): >+ * Modules/webgpu/WHLSL/WHLSLVisitor.h: >+ * WebCore.xcodeproj/project.pbxproj: >+ > 2019-01-13 Simon Fraser <simon.fraser@apple.com> > > Minor optimization to RenderText::setRenderedText() >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h >new file mode 100644 >index 0000000000000000000000000000000000000000..4a6d7c4695dc4cac829054e4055578765175f863 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h >@@ -0,0 +1,51 @@ >+/* >+ * Copyright (C) 2019 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. AND ITS CONTRIBUTORS ``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 ITS 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. >+ */ >+ >+#pragma once >+ >+#if ENABLE(WEBGPU) >+ >+#include <cstdint> >+ >+namespace WebCore { >+ >+namespace WHLSL { >+ >+namespace AST { >+ >+enum class AddressSpace : uint8_t { >+ Constant, >+ Device, >+ Threadgroup, >+ Thread >+}; >+ >+} >+ >+} >+ >+} >+ >+#endif >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h >index 89794b8080ad51a4cb6676540ab4edd48b4ccf3e..a3ff6450bb80d3f88b503593e1366f0c2352867c 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLArrayType.h >@@ -55,8 +55,8 @@ public: > > bool isArrayType() const override { return true; } > >- const UnnamedType& type() const { return static_cast<const UnnamedType&>(m_elementType); } >- UnnamedType& type() { return static_cast<UnnamedType&>(m_elementType); } >+ const UnnamedType& type() const { return m_elementType; } >+ UnnamedType& type() { return m_elementType; } > unsigned numElements() const { return m_numElements; } > > UniqueRef<UnnamedType> clone() const override >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h >index 79eb1aec2210b476d3501f0e995a705780d49012..b121fb6c1e1d1792615d9bb0274fe23588a7f2b5 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h >@@ -53,8 +53,8 @@ public: > > bool isAssignmentExpression() const override { return true; } > >- Expression& left() { return static_cast<Expression&>(m_left); } >- Expression& right() { return static_cast<Expression&>(m_right); } >+ Expression& left() { return m_left; } >+ Expression& right() { return m_right; } > > private: > UniqueRef<Expression> m_left; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h >index fe99da24f64f9d6ed60604674ceb875634fb0feb..dd2a665035f32328ee3ce212ce7b5bd8dc3a6f7e 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h >@@ -27,8 +27,10 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLEntryPointType.h" > #include "WHLSLLexer.h" > #include "WHLSLNode.h" >+#include <wtf/Optional.h> > > namespace WebCore { > >@@ -59,7 +61,7 @@ public: > Input, > Output > }; >- virtual bool isAcceptableForShaderItemDirection(ShaderItemDirection, const FunctionDefinition&) const = 0; >+ virtual bool isAcceptableForShaderItemDirection(ShaderItemDirection, const Optional<EntryPointType>&) const = 0; > > private: > Lexer::Token m_origin; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp >index 414bd45a9a2af755a7f440b1fb0343403907313c..8e95e39bf0d63f4b4de5fe792101888ee065c61f 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp >@@ -73,10 +73,10 @@ bool BuiltInSemantic::isAcceptableType(const UnnamedType& unnamedType, const Int > } > } > >-bool BuiltInSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition& functionDefinition) const >+bool BuiltInSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const Optional<EntryPointType>& entryPointType) const > { >- switch (*functionDefinition.entryPointType()) { >- case FunctionDeclaration::EntryPointType::Vertex: >+ switch (*entryPointType) { >+ case EntryPointType::Vertex: > switch (direction) { > case ShaderItemDirection::Input: > switch (m_variable) { >@@ -95,7 +95,7 @@ bool BuiltInSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection dir > return false; > } > } >- case FunctionDeclaration::EntryPointType::Fragment: >+ case EntryPointType::Fragment: > switch (direction) { > case ShaderItemDirection::Input: > switch (m_variable) { >@@ -117,7 +117,7 @@ bool BuiltInSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection dir > return false; > } > } >- case FunctionDeclaration::EntryPointType::Compute: >+ case EntryPointType::Compute: > switch (direction) { > case ShaderItemDirection::Input: > switch (m_variable) { >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h >index ebde1d084fd3772172a4f7f537a330f0a1610851..43b6986af7d4b71c28677ec65cecd8ea7c47304a 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h >@@ -81,7 +81,7 @@ public: > } > > bool isAcceptableType(const UnnamedType&, const Intrinsics&) const override; >- bool isAcceptableForShaderItemDirection(ShaderItemDirection, const FunctionDefinition&) const override; >+ bool isAcceptableForShaderItemDirection(ShaderItemDirection, const Optional<EntryPointType>&) const override; > > private: > Variable m_variable; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h >index df68c2a1334d29e913bad45fcc41a257931c087a..3d1ae1cec357899bd87fffd145406db329f0864a 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h >@@ -28,7 +28,7 @@ > #if ENABLE(WEBGPU) > > #include "WHLSLBooleanLiteral.h" >-#include "WHLSLConstantExpressionEnumerationMemberReference.h" >+#include "WHLSLEnumerationMemberLiteral.h" > #include "WHLSLFloatLiteral.h" > #include "WHLSLIntegerLiteral.h" > #include "WHLSLNullLiteral.h" >@@ -71,8 +71,8 @@ public: > { > } > >- ConstantExpression(ConstantExpressionEnumerationMemberReference&& constantExpressionEnumerationMemberReference) >- : m_variant(WTFMove(constantExpressionEnumerationMemberReference)) >+ ConstantExpression(EnumerationMemberLiteral&& enumerationMemberLiteral) >+ : m_variant(WTFMove(enumerationMemberLiteral)) > { > } > >@@ -110,8 +110,8 @@ public: > return nullLiteral.clone(); > }, [&](const BooleanLiteral& booleanLiteral) -> ConstantExpression { > return booleanLiteral.clone(); >- }, [&](const ConstantExpressionEnumerationMemberReference& constantExpressionEnumerationMemberReference) -> ConstantExpression { >- return constantExpressionEnumerationMemberReference.clone(); >+ }, [&](const EnumerationMemberLiteral& enumerationMemberLiteral) -> ConstantExpression { >+ return enumerationMemberLiteral.clone(); > }), m_variant); > } > >@@ -133,10 +133,10 @@ public: > result = booleanLiteral.value() == otherBooleanLiteral.value(); > } else > result = false; >- }, [&](const ConstantExpressionEnumerationMemberReference& constantExpressionEnumerationMemberReference) { >- if (WTF::holds_alternative<ConstantExpressionEnumerationMemberReference>(other.m_variant)) { >- const auto& otherMemberReference = WTF::get<ConstantExpressionEnumerationMemberReference>(other.m_variant); >- result = constantExpressionEnumerationMemberReference.enumerationMember() == otherMemberReference.enumerationMember(); >+ }, [&](const EnumerationMemberLiteral& enumerationMemberLiteral) { >+ if (WTF::holds_alternative<EnumerationMemberLiteral>(other.m_variant)) { >+ const auto& otherMemberReference = WTF::get<EnumerationMemberLiteral>(other.m_variant); >+ result = enumerationMemberLiteral.enumerationMember() == otherMemberReference.enumerationMember(); > } else > result = false; > })); >@@ -154,7 +154,7 @@ public: > result = false; > }, [&](const BooleanLiteral&) { > result = false; >- }, [&](const ConstantExpressionEnumerationMemberReference&) { >+ }, [&](const EnumerationMemberLiteral&) { > result = false; > })); > >@@ -169,7 +169,7 @@ private: > FloatLiteral, > NullLiteral, > BooleanLiteral, >- ConstantExpressionEnumerationMemberReference >+ EnumerationMemberLiteral > > m_variant; > }; > >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h >deleted file mode 100644 >index 5857d947285b967ad11d916e0ee02fba5f150d0a..0000000000000000000000000000000000000000 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h >+++ /dev/null >@@ -1,108 +0,0 @@ >-/* >- * Copyright (C) 2019 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. AND ITS CONTRIBUTORS ``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 ITS 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. >- */ >- >-#pragma once >- >-#if ENABLE(WEBGPU) >- >-#include "WHLSLLexer.h" >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-namespace WHLSL { >- >-namespace AST { >- >-class EnumerationDefinition; >-class EnumerationMember; >- >-class ConstantExpressionEnumerationMemberReference : public Expression { >-public: >- ConstantExpressionEnumerationMemberReference(Lexer::Token&& origin, String&& left, String&& right) >- : Expression(WTFMove(origin)) >- , m_left(WTFMove(left)) >- , m_right(WTFMove(right)) >- { >- } >- >- virtual ~ConstantExpressionEnumerationMemberReference() = default; >- >- explicit ConstantExpressionEnumerationMemberReference(const ConstantExpressionEnumerationMemberReference&) = default; >- ConstantExpressionEnumerationMemberReference(ConstantExpressionEnumerationMemberReference&&) = default; >- >- ConstantExpressionEnumerationMemberReference& operator=(const ConstantExpressionEnumerationMemberReference&) = delete; >- ConstantExpressionEnumerationMemberReference& operator=(ConstantExpressionEnumerationMemberReference&&) = default; >- >- const String& left() const { return m_left; } >- const String& right() const { return m_right; } >- >- ConstantExpressionEnumerationMemberReference clone() const >- { >- auto result = ConstantExpressionEnumerationMemberReference(Lexer::Token(origin()), String(m_left), String(m_right)); >- result.m_enumerationMember = m_enumerationMember; >- return result; >- } >- >- EnumerationDefinition* enumerationDefinition() >- { >- return m_enumerationDefinition; >- } >- >- EnumerationDefinition* enumerationDefinition() const >- { >- return m_enumerationDefinition; >- } >- >- EnumerationMember* enumerationMember() >- { >- return m_enumerationMember; >- } >- >- EnumerationMember* enumerationMember() const >- { >- return m_enumerationMember; >- } >- >- void setEnumerationMember(EnumerationDefinition& enumerationDefinition, EnumerationMember& enumerationMember) >- { >- m_enumerationDefinition = &enumerationDefinition; >- m_enumerationMember = &enumerationMember; >- } >- >-private: >- String m_left; >- String m_right; >- EnumerationDefinition* m_enumerationDefinition { nullptr }; >- EnumerationMember* m_enumerationMember { nullptr }; >-}; >- >-} // namespace AST >- >-} >- >-} >- >-#endif >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h >index 545912ab38f7f8ac2144fafb7c4f2fa584a945a5..e12122e71ceba821cac8bad865c09c92fbc19566 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h >@@ -52,7 +52,7 @@ public: > > bool isDereferenceExpression() const override { return true; } > >- Expression& pointer() { return static_cast<Expression&>(m_pointer); } >+ Expression& pointer() { return m_pointer; } > > private: > UniqueRef<Expression> m_pointer; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h >index 014783775e33e1c7749bbb3d53cd22f0377396b5..1d921f6dc004a3e7920f717331374ad6d47cb830 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h >@@ -54,8 +54,8 @@ public: > > bool isDoWhileLoop() const override { return true; } > >- Statement& body() { return static_cast<Statement&>(m_body); } >- Expression& conditional() { return static_cast<Expression&>(m_conditional); } >+ Statement& body() { return m_body; } >+ Expression& conditional() { return m_conditional; } > > private: > UniqueRef<Statement> m_body; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h >index 54d083a5c0680b75493bf4398d6b353e6d9f7597..70aea4bb76999da87258c4b7444e36cf3cc26e7a 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h >@@ -53,7 +53,7 @@ public: > > bool isEffectfulExpressionStatement() const override { return true; } > >- Expression& effectfulExpression() { return static_cast<Expression&>(m_effectfulExpression); } >+ Expression& effectfulExpression() { return m_effectfulExpression; } > > private: > UniqueRef<Expression> m_effectfulExpression; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h >new file mode 100644 >index 0000000000000000000000000000000000000000..e288770d4da44aa2934a8bcac114f619bc40c9f0 >--- /dev/null >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h >@@ -0,0 +1,51 @@ >+/* >+ * Copyright (C) 2019 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. AND ITS CONTRIBUTORS ``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 ITS 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. >+ */ >+ >+#pragma once >+ >+#if ENABLE(WEBGPU) >+ >+#include <cstdint> >+ >+namespace WebCore { >+ >+namespace WHLSL { >+ >+namespace AST { >+ >+enum class EntryPointType : uint8_t { >+ Vertex, >+ Fragment, >+ Compute, >+ // FIXME: Add an entry point type for testing >+}; >+ >+} >+ >+} >+ >+} >+ >+#endif >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h >index 55089a1ab7d1f0fa1840bfa1cb1acbf7384bdc0d..0bcea9596dad0605f2fede1ce2855c4aa841c61e 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h >@@ -46,7 +46,7 @@ namespace AST { > > class EnumerationDefinition : public NamedType { > public: >- EnumerationDefinition(Lexer::Token&& origin, String&& name, Optional<UniqueRef<UnnamedType>>&& type) >+ EnumerationDefinition(Lexer::Token&& origin, String&& name, UniqueRef<UnnamedType>&& type) > : NamedType(WTFMove(origin), WTFMove(name)) > , m_type(WTFMove(type)) > { >@@ -59,7 +59,7 @@ public: > > bool isEnumerationDefinition() const override { return true; } > >- UnnamedType* type() { return m_type ? &static_cast<UnnamedType&>(*m_type) : nullptr; } >+ UnnamedType& type() { return m_type; } > > bool add(EnumerationMember&& member) > { >@@ -84,7 +84,7 @@ public: > } > > private: >- Optional<UniqueRef<UnnamedType>> m_type; >+ UniqueRef<UnnamedType> m_type; > HashMap<String, std::unique_ptr<EnumerationMember>> m_members; > }; > >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h >index ba64303802b1b5a4197d9916c1a1520b20f60cc9..ee745e54bd0542f37bb3d9814374eb3e60fca591 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h >@@ -27,9 +27,8 @@ > > #if ENABLE(WEBGPU) > >-#include "WHLSLEnumerationMember.h" >-#include "WHLSLExpression.h" > #include "WHLSLLexer.h" >+#include <wtf/text/WTFString.h> > > namespace WebCore { > >@@ -37,25 +36,77 @@ namespace WHLSL { > > namespace AST { > >+class EnumerationDefinition; >+class EnumerationMember; >+ > class EnumerationMemberLiteral : public Expression { > public: >- EnumerationMemberLiteral(Lexer::Token&& origin, EnumerationMember& enumerationMember) >+ EnumerationMemberLiteral(Lexer::Token&& origin, String&& left, String&& right) > : Expression(WTFMove(origin)) >- , m_enumerationMember(enumerationMember) >+ , m_left(WTFMove(left)) >+ , m_right(WTFMove(right)) > { > } > > virtual ~EnumerationMemberLiteral() = default; > >- EnumerationMemberLiteral(const EnumerationMemberLiteral&) = delete; >+ explicit EnumerationMemberLiteral(const EnumerationMemberLiteral&) = default; > EnumerationMemberLiteral(EnumerationMemberLiteral&&) = default; > >+ EnumerationMemberLiteral& operator=(const EnumerationMemberLiteral&) = delete; >+ EnumerationMemberLiteral& operator=(EnumerationMemberLiteral&&) = default; >+ > bool isEnumerationMemberLiteral() const override { return true; } > >- EnumerationMember& enumerationMember() { return m_enumerationMember; } >+ static EnumerationMemberLiteral wrap(Lexer::Token&& origin, String&& left, String&& right, EnumerationDefinition& enumerationDefinition, EnumerationMember& enumerationMember) >+ { >+ EnumerationMemberLiteral result(WTFMove(origin), WTFMove(left), WTFMove(right)); >+ result.m_enumerationDefinition = &enumerationDefinition; >+ result.m_enumerationMember = &enumerationMember; >+ return result; >+ } >+ >+ const String& left() const { return m_left; } >+ const String& right() const { return m_right; } >+ >+ EnumerationMemberLiteral clone() const >+ { >+ auto result = EnumerationMemberLiteral(Lexer::Token(origin()), String(m_left), String(m_right)); >+ result.m_enumerationMember = m_enumerationMember; >+ return result; >+ } >+ >+ EnumerationDefinition* enumerationDefinition() >+ { >+ return m_enumerationDefinition; >+ } >+ >+ EnumerationDefinition* enumerationDefinition() const >+ { >+ return m_enumerationDefinition; >+ } >+ >+ EnumerationMember* enumerationMember() >+ { >+ return m_enumerationMember; >+ } >+ >+ EnumerationMember* enumerationMember() const >+ { >+ return m_enumerationMember; >+ } >+ >+ void setEnumerationMember(EnumerationDefinition& enumerationDefinition, EnumerationMember& enumerationMember) >+ { >+ m_enumerationDefinition = &enumerationDefinition; >+ m_enumerationMember = &enumerationMember; >+ } > > private: >- EnumerationMember& m_enumerationMember; >+ String m_left; >+ String m_right; >+ EnumerationDefinition* m_enumerationDefinition { nullptr }; >+ EnumerationMember* m_enumerationMember { nullptr }; > }; > > } // namespace AST >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLExpression.h >index 741300dbeac4c9f2627889908010c1a853523724..583a62ecec9ed8f7bcb0c6492dd631eb72456e09 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLExpression.h >@@ -27,8 +27,12 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLAddressSpace.h" > #include "WHLSLLexer.h" >+#include "WHLSLUnnamedType.h" > #include "WHLSLValue.h" >+#include <wtf/Optional.h> >+#include <wtf/UniqueRef.h> > > namespace WebCore { > >@@ -53,6 +57,22 @@ public: > > const Lexer::Token& origin() const { return m_origin; } > >+ UnnamedType* type() { return m_type ? &*m_type : nullptr; } >+ >+ void setType(UniqueRef<UnnamedType>&& type) >+ { >+ ASSERT(!m_type); >+ m_type = WTFMove(type); >+ } >+ >+ const Optional<AddressSpace>& addressSpace() const { return m_addressSpace; } >+ >+ void setAddressSpace(Optional<AddressSpace>& addressSpace) >+ { >+ ASSERT(!m_addressSpace); >+ m_addressSpace = addressSpace; >+ } >+ > virtual bool isAssignmentExpression() const { return false; } > virtual bool isBooleanLiteral() const { return false; } > virtual bool isCallExpression() const { return false; } >@@ -76,6 +96,8 @@ public: > > private: > Lexer::Token m_origin; >+ Optional<UniqueRef<UnnamedType>> m_type; >+ Optional<AddressSpace> m_addressSpace; > }; > > } // namespace AST >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp >index 81c9ddeec77b7644f247d2cfaeb710f616085ea7..0b671261148439f0f9ba8651e760316a32769e68 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp >@@ -67,7 +67,7 @@ bool FloatLiteralType::canResolve(const Type& type) const > > unsigned FloatLiteralType::conversionCost(const UnnamedType& unnamedType) const > { >- if (matches(unnamedType, static_cast<const TypeReference&>(m_preferredType))) >+ if (matches(unnamedType, m_preferredType)) > return 0; > return 1; > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h >index 568064303478ce1c401231dcb37fabf542b1b047..bc9f037099de0d810bed89ab12a451e5b3b08366 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h >@@ -53,7 +53,7 @@ public: > > bool isFloatLiteralType() const override { return true; } > >- TypeReference& preferredType() { return static_cast<TypeReference&>(m_preferredType); } >+ TypeReference& preferredType() { return m_preferredType; } > > bool canResolve(const Type&) const override; > unsigned conversionCost(const UnnamedType&) const override; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLForLoop.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLForLoop.h >index 713edc92df7b524678cb8a813b35dc6471df46d2..3cdc418faaa1c893ed24272557a6db8b59a75b70 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLForLoop.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLForLoop.h >@@ -63,9 +63,9 @@ public: > bool isForLoop() const override { return true; } > > Variant<VariableDeclarationsStatement, UniqueRef<Expression>>& initialization() { return m_initialization; } >- Expression* condition() { return m_condition ? &static_cast<Expression&>(*m_condition) : nullptr; } >- Expression* increment() { return m_increment ? &static_cast<Expression&>(*m_increment) : nullptr; } >- Statement& body() { return static_cast<Statement&>(m_body); } >+ Expression* condition() { return m_condition ? &*m_condition : nullptr; } >+ Expression* increment() { return m_increment ? &*m_increment : nullptr; } >+ Statement& body() { return m_body; } > > private: > Variant<VariableDeclarationsStatement, UniqueRef<Expression>> m_initialization; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h >index 190bbb80c30b35916ac2abc385b3bd594d3c672c..508285846070577d894c534a3974bce0abb21f11 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h >@@ -27,6 +27,7 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLEntryPointType.h" > #include "WHLSLFunctionAttribute.h" > #include "WHLSLLexer.h" > #include "WHLSLNode.h" >@@ -44,13 +45,6 @@ namespace AST { > > class FunctionDeclaration : public Node { > public: >- enum class EntryPointType : uint8_t { >- Vertex, >- Fragment, >- Compute, >- // FIXME: Add an entry point type for testing >- }; >- > FunctionDeclaration(Lexer::Token&& origin, AttributeBlock&& attributeBlock, Optional<EntryPointType> entryPointType, UniqueRef<UnnamedType>&& type, String&& name, VariableDeclarations&& parameters, Optional<Semantic>&& semantic, bool isOperator) > : m_origin(WTFMove(origin)) > , m_attributeBlock(WTFMove(attributeBlock)) >@@ -73,8 +67,8 @@ public: > > AttributeBlock& attributeBlock() { return m_attributeBlock; } > const Optional<EntryPointType>& entryPointType() const { return m_entryPointType; } >- const UnnamedType& type() const { return static_cast<const UnnamedType&>(m_type); } >- UnnamedType& type() { return static_cast<UnnamedType&>(m_type); } >+ const UnnamedType& type() const { return m_type; } >+ UnnamedType& type() { return m_type; } > const String& name() const { return m_name; } > bool isCast() const { return m_name == "operator cast"; } > const VariableDeclarations& parameters() const { return m_parameters; } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h >index 9b7cf4b37af6df0bd94ea279b480b13abecb3344..bf6f65696c65a881f92ca1c7630a1370b4ed530d 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h >@@ -56,9 +56,9 @@ public: > > bool isIfStatement() const override { return true; } > >- Expression& conditional() { return static_cast<Expression&>(m_conditional); } >- Statement& body() { return static_cast<Statement&>(m_body); } >- Statement* elseBody() { return m_elseBody ? &static_cast<Statement&>(*m_elseBody) : nullptr; } >+ Expression& conditional() { return m_conditional; } >+ Statement& body() { return m_body; } >+ Statement* elseBody() { return m_elseBody ? &*m_elseBody : nullptr; } > > private: > UniqueRef<Expression> m_conditional; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h >index 25ba6e78a59f7678862b8485048f9dea8f00b79e..347bcfec4ca42614db9baa7086b5123b2296e680 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h >@@ -67,7 +67,7 @@ public: > return "operator[]="_str; > } > >- Expression& indexExpression() { return static_cast<Expression&>(m_index); } >+ Expression& indexExpression() { return m_index; } > > private: > UniqueRef<Expression> m_index; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp >index e87acdacab7927c49196dcb49f84b609c7f2b21b..4fc6863a9d9c67c82584b4eb11295a8725201061 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp >@@ -68,7 +68,7 @@ bool IntegerLiteralType::canResolve(const Type& type) const > > unsigned IntegerLiteralType::conversionCost(const UnnamedType& unnamedType) const > { >- if (matches(unnamedType, static_cast<const TypeReference&>(m_preferredType))) >+ if (matches(unnamedType, m_preferredType)) > return 0; > return 1; > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h >index 426f0fe182596cddf8f4a8ad3058110b222aa748..55617b6ba9eafbe185cdfe1ecf0eb3145dcaebcd 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h >@@ -53,7 +53,7 @@ public: > > bool isIntegerLiteralType() const override { return true; } > >- TypeReference& preferredType() { return static_cast<TypeReference&>(m_preferredType); } >+ TypeReference& preferredType() { return m_preferredType; } > > bool canResolve(const Type&) const override; > unsigned conversionCost(const UnnamedType&) const override; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h >index ad35e88a1b0efc1687d4ae7eb5a25f9d34bc0ae2..fbfc9359611b86ab444a81d547b0baef481ff0ed 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h >@@ -61,8 +61,8 @@ public: > > bool isLogicalExpression() const override { return true; } > >- Expression& left() { return static_cast<Expression&>(m_left); } >- Expression& right() { return static_cast<Expression&>(m_right); } >+ Expression& left() { return m_left; } >+ Expression& right() { return m_right; } > > private: > Type m_type; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h >index 1a972be6b2d6a4b075f15b2a29614f14c843a599..1497632416bcca8169c7f25899bc443551b3ac8a 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h >@@ -52,7 +52,7 @@ public: > > bool isLogicalNotExpression() const override { return true; } > >- Expression& operand() { return static_cast<Expression&>(m_operand); } >+ Expression& operand() { return m_operand; } > > private: > UniqueRef<Expression> m_operand; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h >index bc019531df630ea4cfd5d3bec445e06d2ca8ea26..6316f54e16326b4a483fa872e1f47bb048edf88e 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h >@@ -52,7 +52,7 @@ public: > > bool isMakeArrayReferenceExpression() const override { return true; } > >- Expression& lValue() { return static_cast<Expression&>(m_lValue); } >+ Expression& lValue() { return m_lValue; } > > private: > UniqueRef<Expression> m_lValue; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h >index 048a44401ea6b1492c51d4e090a6d4b09e54ad15..7b052b6d5f2887f592df44fd9409c4fa95203aa8 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h >@@ -52,7 +52,7 @@ public: > > bool isMakePointerExpression() const override { return true; } > >- Expression& lValue() { return static_cast<Expression&>(m_lValue); } >+ Expression& lValue() { return m_lValue; } > > private: > UniqueRef<Expression> m_lValue; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h >index e28755edb2bb9b90dee0ae762a3831d0a03aded7..2ec34e15d8a40e5ad2e2bf89680c21c3344c9988 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h >@@ -73,7 +73,7 @@ public: > m_possibleAndOverloads = overloads; > } > >- Expression& base() { return static_cast<Expression&>(m_base); } >+ Expression& base() { return m_base; } > > private: > UniqueRef<Expression> m_base; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h >index f29b29393eae224aa2d674ec25a8165906a2e6b9..79d8d0f708e8d0578312c81794e88edaf3487cf9 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h >@@ -85,11 +85,11 @@ public: > > bool isReadModifyWriteExpression() const override { return true; } > >- Expression& lValue() { return static_cast<Expression&>(m_lValue); } >+ Expression& lValue() { return m_lValue; } > VariableDeclaration& oldValue() { return m_oldValue; } > VariableDeclaration& newValue() { return m_newValue; } >- Expression* newValueExpression() { return m_newValueExpression ? &static_cast<Expression&>(*m_newValueExpression) : nullptr; } >- Expression* resultExpression() { return m_resultExpression ? &static_cast<Expression&>(*m_resultExpression) : nullptr; } >+ Expression* newValueExpression() { return m_newValueExpression ? &*m_newValueExpression : nullptr; } >+ Expression* resultExpression() { return m_resultExpression ? &*m_resultExpression : nullptr; } > > private: > template<class U, class... Args> friend UniqueRef<U> WTF::makeUniqueRef(Args&&...); >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h >index 64c84bcb4c395ed3766c37bc71bc05beed279af5..8811ac9ad427dd02e7f141b06432bc5033869653 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h >@@ -27,6 +27,7 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLAddressSpace.h" > #include "WHLSLLexer.h" > #include "WHLSLUnnamedType.h" > #include <wtf/UniqueRef.h> >@@ -40,13 +41,6 @@ namespace AST { > > class ReferenceType : public UnnamedType { > public: >- enum class AddressSpace : uint8_t { >- Constant, >- Device, >- Threadgroup, >- Thread >- }; >- > ReferenceType(Lexer::Token&& origin, AddressSpace addressSpace, UniqueRef<UnnamedType>&& elementType) > : UnnamedType(WTFMove(origin)) > , m_addressSpace(addressSpace) >@@ -62,8 +56,8 @@ public: > bool isReferenceType() const override { return false; } > > AddressSpace addressSpace() const { return m_addressSpace; } >- const UnnamedType& elementType() const { return static_cast<const UnnamedType&>(m_elementType); } >- UnnamedType& elementType() { return static_cast<UnnamedType&>(m_elementType); } >+ const UnnamedType& elementType() const { return m_elementType; } >+ UnnamedType& elementType() { return m_elementType; } > > private: > AddressSpace m_addressSpace; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h >index cd71bd4cc4b842fdfeee1249a367384173ddd646..f01f8664881f8804499aa9e77627ddfb17780e8f 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h >@@ -58,8 +58,8 @@ public: > virtual bool canResolve(const Type&) const = 0; > virtual unsigned conversionCost(const UnnamedType&) const = 0; > >- const UnnamedType* resolvedType() const { return m_resolvedType ? &static_cast<const UnnamedType&>(*m_resolvedType) : nullptr; } >- UnnamedType* resolvedType() { return m_resolvedType ? &static_cast<UnnamedType&>(*m_resolvedType) : nullptr; } >+ const UnnamedType* resolvedType() const { return m_resolvedType ? &*m_resolvedType : nullptr; } >+ UnnamedType* resolvedType() { return m_resolvedType ? &*m_resolvedType : nullptr; } > > void resolve(UniqueRef<UnnamedType>&& type) > { >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp >index 8440960c6e3b4872d9e93443fb88c7358ed36cbd..be1a873b63680ce7ef4c0adca296eca9c91ee291 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp >@@ -28,6 +28,7 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLAddressSpace.h" > #include "WHLSLArrayType.h" > #include "WHLSLInferTypes.h" > #include "WHLSLIntrinsics.h" >@@ -46,7 +47,7 @@ bool ResourceSemantic::isAcceptableType(const UnnamedType& unnamedType, const In > case Mode::UnorderedAccessView: > if (is<ReferenceType>(unnamedType)) { > auto& referenceType = downcast<ReferenceType>(unnamedType); >- return referenceType.addressSpace() == ReferenceType::AddressSpace::Constant || referenceType.addressSpace() == ReferenceType::AddressSpace::Device; >+ return referenceType.addressSpace() == AddressSpace::Constant || referenceType.addressSpace() == AddressSpace::Device; > } > if (is<ArrayType>(unnamedType)) > return true; >@@ -59,7 +60,7 @@ bool ResourceSemantic::isAcceptableType(const UnnamedType& unnamedType, const In > return false; > case Mode::Texture: > if (is<ReferenceType>(unnamedType)) >- return downcast<ReferenceType>(unnamedType).addressSpace() == ReferenceType::AddressSpace::Constant; >+ return downcast<ReferenceType>(unnamedType).addressSpace() == AddressSpace::Constant; > if (is<ArrayType>(unnamedType)) > return true; > if (is<TypeReference>(unnamedType)) { >@@ -71,14 +72,14 @@ bool ResourceSemantic::isAcceptableType(const UnnamedType& unnamedType, const In > return false; > case Mode::Buffer: > if (is<ReferenceType>(unnamedType)) >- return downcast<ReferenceType>(unnamedType).addressSpace() == ReferenceType::AddressSpace::Constant; >+ return downcast<ReferenceType>(unnamedType).addressSpace() == AddressSpace::Constant; > return is<ArrayType>(unnamedType); > case Mode::Sampler: > return matches(unnamedType, intrinsics.samplerType()); > } > } > >-bool ResourceSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition&) const >+bool ResourceSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const Optional<EntryPointType>&) const > { > return direction == ShaderItemDirection::Input; > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h >index 4b02be0207bc3c81fd2929bbb0e1e598b32cddd8..e7ca064b66885bc5432545f99bba8d3e7bc6f4d7 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h >@@ -73,7 +73,7 @@ public: > } > > bool isAcceptableType(const UnnamedType&, const Intrinsics&) const override; >- bool isAcceptableForShaderItemDirection(ShaderItemDirection, const FunctionDefinition&) const override; >+ bool isAcceptableForShaderItemDirection(ShaderItemDirection, const Optional<EntryPointType>&) const override; > > private: > Mode m_mode; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReturn.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReturn.h >index 77eb24684f04722485644daf49b72078303cf45a..f9d209d44861ee05b143c4cbe4e9253b13bd6a91 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReturn.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReturn.h >@@ -54,7 +54,7 @@ public: > > bool isReturn() const override { return true; } > >- Expression* value() { return m_value ? &static_cast<Expression&>(*m_value) : nullptr; } >+ Expression* value() { return m_value ? &*m_value : nullptr; } > > FunctionDefinition* function() { return m_function; } > void setFunction(FunctionDefinition* functionDefinition) { m_function = functionDefinition; } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp >index 421c793c922bbf649019aa390759e533ab4068cd..7b4780951b2f7de1736ec785990a6ed53a3146dc 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp >@@ -48,7 +48,7 @@ bool SpecializationConstantSemantic::isAcceptableType(const UnnamedType& unnamed > return downcast<NativeTypeDeclaration>(*typeReference.resolvedType()).isNumber(); > } > >-bool SpecializationConstantSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition&) const >+bool SpecializationConstantSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const Optional<EntryPointType>&) const > { > return direction == ShaderItemDirection::Input; > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h >index d62abbcebe550e2b81901982c6893b38bc4cf240..656315a792a4feb5a8ebcb4db7a87f399ac2f866 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h >@@ -59,7 +59,7 @@ public: > } > > bool isAcceptableType(const UnnamedType&, const Intrinsics&) const override; >- bool isAcceptableForShaderItemDirection(ShaderItemDirection, const FunctionDefinition&) const override; >+ bool isAcceptableForShaderItemDirection(ShaderItemDirection, const Optional<EntryPointType>&) const override; > > private: > }; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp >index 22572c812c839a9aa3c5ee62fb32f7104d91fec5..bca315ab85907fb2de753c39823330d5817f2de7 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp >@@ -59,14 +59,14 @@ bool StageInOutSemantic::isAcceptableType(const UnnamedType& unnamedType, const > || nativeTypeDeclaration.isMatrix(); > } > >-bool StageInOutSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const FunctionDefinition& functionDefinition) const >+bool StageInOutSemantic::isAcceptableForShaderItemDirection(ShaderItemDirection direction, const Optional<EntryPointType>& entryPointType) const > { >- switch (*functionDefinition.entryPointType()) { >- case FunctionDeclaration::EntryPointType::Vertex: >+ switch (*entryPointType) { >+ case EntryPointType::Vertex: > return true; >- case FunctionDeclaration::EntryPointType::Fragment: >+ case EntryPointType::Fragment: > return direction == ShaderItemDirection::Input; >- case FunctionDeclaration::EntryPointType::Compute: >+ case EntryPointType::Compute: > return false; > } > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h >index 4ae8532ad7c7e2ce8e850667cacf788615f6069a..61764c9e145eb9e8e3fd7d927e90c133007cd314 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h >@@ -62,7 +62,7 @@ public: > } > > bool isAcceptableType(const UnnamedType&, const Intrinsics&) const override; >- bool isAcceptableForShaderItemDirection(ShaderItemDirection, const FunctionDefinition&) const override; >+ bool isAcceptableForShaderItemDirection(ShaderItemDirection, const Optional<EntryPointType>&) const override; > > private: > unsigned m_index; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h >index 4cd64e2e28afe56cbb8cf032c149fa696ac4e6eb..8472f5c962c87cae0d7170ef438ed47dabdd039b 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h >@@ -57,7 +57,7 @@ public: > StructureElement(StructureElement&&) = default; > > const Lexer::Token& origin() const { return m_origin; } >- UnnamedType& type() { return static_cast<UnnamedType&>(m_type); } >+ UnnamedType& type() { return m_type; } > const String& name() { return m_name; } > Optional<Semantic>& semantic() { return m_semantic; } > >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h >index 6b19d70422c94d99ed13904205063de12148b532..7c160ba4e79dcc13abac32f05ba1213c39fb1e8b 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h >@@ -55,7 +55,7 @@ public: > > bool isSwitchStatement() const override { return true; } > >- Expression& value() { return static_cast<Expression&>(m_value); } >+ Expression& value() { return m_value; } > Vector<SwitchCase>& switchCases() { return m_switchCases; } > > private: >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h >index b41d12b5d229fd7d49d0f8590e9fde1a50806c2d..fe5614db12e1b490f57a2d8dede3e29f236b44d7 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h >@@ -54,9 +54,9 @@ public: > > bool isTernaryExpression() const override { return true; } > >- Expression& predicate() { return static_cast<Expression&>(m_predicate); } >- Expression& bodyExpression() { return static_cast<Expression&>(m_bodyExpression); } >- Expression& elseExpression() { return static_cast<Expression&>(m_elseExpression); } >+ Expression& predicate() { return m_predicate; } >+ Expression& bodyExpression() { return m_bodyExpression; } >+ Expression& elseExpression() { return m_elseExpression; } > > private: > UniqueRef<Expression> m_predicate; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h >index 2e3ff364d6bd6063052fc3af1b5fc46f31ef64ef..ad87a0027dfe6c620cc5e616113f346f6c73317b 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h >@@ -55,7 +55,7 @@ public: > > bool isTypeDefinition() const override { return true; } > >- UnnamedType& type() { return static_cast<UnnamedType&>(m_type); } >+ UnnamedType& type() { return m_type; } > > const Type& unifyNode() const override > { >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp >index 01f31979146bc7c4ce835cb8f5f5ddc42f0a1ec8..7fdf8cb4d98c0aa0c310ad30389ef22a3a781ad7 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp >@@ -71,7 +71,7 @@ bool UnsignedIntegerLiteralType::canResolve(const Type& type) const > > unsigned UnsignedIntegerLiteralType::conversionCost(const UnnamedType& unnamedType) const > { >- if (matches(unnamedType, static_cast<const TypeReference&>(m_preferredType))) >+ if (matches(unnamedType, m_preferredType)) > return 0; > return 1; > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h >index 362efa96db3bb549f72186fe2f19f1c59fb17db7..95fbff6b9029f05ab524f730f9543f4d1e702707 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h >@@ -53,7 +53,7 @@ public: > > bool isUnsignedIntegerLiteralType() const override { return true; } > >- TypeReference& preferredType() { return static_cast<TypeReference&>(m_preferredType); } >+ TypeReference& preferredType() { return m_preferredType; } > > bool canResolve(const Type&) const override; > unsigned conversionCost(const UnnamedType&) const override; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h >index b4494602cfbaab1135d7162356a0a20870122ebe..19824f94054e4b3b7d7cf24f63c0119b8a63f4fb 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h >@@ -65,9 +65,10 @@ public: > String& name() { return m_name; } > > const Optional<UniqueRef<UnnamedType>>& type() const { return m_type; } // Anonymous variables inside ReadModifyWriteExpressions have their type set by the type checker. >- UnnamedType* type() { return m_type ? &static_cast<UnnamedType&>(*m_type) : nullptr; } >+ UnnamedType* type() { return m_type ? &*m_type : nullptr; } > Optional<Semantic>& semantic() { return m_semantic; } >- Expression* initializer() { return m_initializer ? &static_cast<Expression&>(*m_initializer) : nullptr; } >+ Expression* initializer() { return m_initializer ? &*m_initializer : nullptr; } >+ bool isAnonymous() const { return m_name.isNull(); } > > private: > Lexer::Token m_origin; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h >index a7e8682af9de20c62e45ae031ad21084d41fc9be..a6c7b5e9a5a26797703e8d6d7d35b27fe450c66a 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h >@@ -54,8 +54,8 @@ public: > > bool isWhileLoop() const override { return true; } > >- Expression& conditional() { return static_cast<Expression&>(m_conditional); } >- Statement& body() { return static_cast<Statement&>(m_body); } >+ Expression& conditional() { return m_conditional; } >+ Statement& body() { return m_body; } > > private: > UniqueRef<Expression> m_conditional; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp >index 57b462e0c1f37ad3ca2c72c998eeb5d36dd2cdb8..8d5f68f07b6c038fe5ba7bbc82dcecd18c2ebeeb 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp >@@ -41,9 +41,9 @@ bool checkDuplicateFunctions(const Program& program) > { > Vector<std::reference_wrapper<const AST::FunctionDeclaration>> functions; > for (auto& functionDefinition : program.functionDefinitions()) >- functions.append(static_cast<const AST::FunctionDefinition&>(functionDefinition)); >+ functions.append(functionDefinition); > for (auto& nativeFunctionDeclaration : program.nativeFunctionDeclarations()) >- functions.append(static_cast<const AST::NativeFunctionDeclaration&>(nativeFunctionDeclaration)); >+ functions.append(nativeFunctionDeclaration); > > std::sort(functions.begin(), functions.end(), [](const AST::FunctionDeclaration& a, const AST::FunctionDeclaration& b) -> bool { > if (a.name().length() < b.name().length()) >@@ -99,7 +99,7 @@ bool checkDuplicateFunctions(const Program& program) > && functions[i].get().parameters().size() == 2 > && is<AST::ReferenceType>(static_cast<const AST::UnnamedType&>(*functions[i].get().parameters()[0].type())) > && is<AST::ReferenceType>(static_cast<const AST::UnnamedType&>(*functions[i].get().parameters()[1].type())) >- && matches(static_cast<const AST::UnnamedType&>(*functions[i].get().parameters()[0].type()), static_cast<const AST::UnnamedType&>(*functions[i].get().parameters()[1].type()))) >+ && matches(*functions[i].get().parameters()[0].type(), *functions[i].get().parameters()[1].type())) > return false; > } > return true; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLInferTypes.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLInferTypes.cpp >index 20e0ef09e41415251e084a82deb55e1f1fce29e2..7cbdb6aff2e26dfee6f61f450b786ce14d27267b 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLInferTypes.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLInferTypes.cpp >@@ -159,16 +159,19 @@ Optional<UniqueRef<AST::UnnamedType>> commit(AST::ResolvableType& resolvableType > { > ASSERT(!resolvableType.resolvedType()); > if (is<AST::FloatLiteralType>(resolvableType)) { >- resolvableType.resolve(downcast<AST::FloatLiteralType>(resolvableType).preferredType().clone()); >- return downcast<AST::FloatLiteralType>(resolvableType).preferredType().clone(); >+ auto& floatLiteralType = downcast<AST::FloatLiteralType>(resolvableType); >+ resolvableType.resolve(floatLiteralType.preferredType().clone()); >+ return floatLiteralType.preferredType().clone(); > } > if (is<AST::IntegerLiteralType>(resolvableType)) { >- resolvableType.resolve(downcast<AST::IntegerLiteralType>(resolvableType).preferredType().clone()); >- return downcast<AST::IntegerLiteralType>(resolvableType).preferredType().clone(); >+ auto& integerLiteralType = downcast<AST::IntegerLiteralType>(resolvableType); >+ resolvableType.resolve(integerLiteralType.preferredType().clone()); >+ return integerLiteralType.preferredType().clone(); > } > if (is<AST::UnsignedIntegerLiteralType>(resolvableType)) { >- resolvableType.resolve(downcast<AST::UnsignedIntegerLiteralType>(resolvableType).preferredType().clone()); >- return downcast<AST::UnsignedIntegerLiteralType>(resolvableType).preferredType().clone(); >+ auto& unsignedIntegerLiteralType = downcast<AST::UnsignedIntegerLiteralType>(resolvableType); >+ resolvableType.resolve(unsignedIntegerLiteralType.preferredType().clone()); >+ return unsignedIntegerLiteralType.preferredType().clone(); > } > if (is<AST::NullLiteralType>(resolvableType)) { > // FIXME: Trying to match nullptr and nullptr fails. >@@ -199,7 +202,7 @@ bool inferTypesForTypeArguments(AST::NamedType& possibleType, AST::TypeArguments > WTF::visit(WTF::makeVisitor([&](AST::ConstantExpression& constantExpression) { > expression = &constantExpression; > }, [&](UniqueRef<AST::TypeReference>& theTypeReference) { >- typeReference = &static_cast<AST::TypeReference&>(theTypeReference); >+ typeReference = &theTypeReference; > }), typeArgument); > }; > >@@ -224,7 +227,7 @@ bool inferTypesForCall(AST::FunctionDeclaration& possibleFunction, Vector<std::r > return false; > for (size_t i = 0; i < possibleFunction.parameters().size(); ++i) { > auto success = WTF::visit(WTF::makeVisitor([&](UniqueRef<AST::UnnamedType>& unnamedType) -> bool { >- return matches(*possibleFunction.parameters()[i].type(), static_cast<AST::UnnamedType&>(unnamedType)); >+ return matches(*possibleFunction.parameters()[i].type(), unnamedType); > }, [&](Ref<ResolvableTypeReference>& resolvableTypeReference) -> bool { > return resolvableTypeReference->resolvableType().canResolve(*possibleFunction.parameters()[i].type()); > }), argumentTypes[i].get()); >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp >index 48fa9302208afefeee7e648cbcf5d37363b63e2c..2e0edef46f4e592abc7a4e910325367f756a0f8a 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.cpp >@@ -103,7 +103,7 @@ void NameResolver::visit(AST::IfStatement& ifStatement) > NameResolver(nameContext).checkErrorAndVisit(ifStatement.body()); > if (ifStatement.elseBody()) { > NameContext nameContext(&m_nameContext); >- NameResolver(nameContext).checkErrorAndVisit(static_cast<AST::Statement&>(*ifStatement.elseBody())); >+ NameResolver(nameContext).checkErrorAndVisit(*ifStatement.elseBody()); > } > } > >@@ -167,17 +167,20 @@ void NameResolver::visit(AST::PropertyAccessExpression& propertyAccessExpression > void NameResolver::visit(AST::DotExpression& dotExpression) > { > if (is<AST::VariableReference>(dotExpression.base())) { >- if (auto enumerationTypes = m_nameContext.getTypes(downcast<AST::VariableReference>(dotExpression.base()).name())) { >+ auto baseName = downcast<AST::VariableReference>(dotExpression.base()).name(); >+ if (auto enumerationTypes = m_nameContext.getTypes(baseName)) { > ASSERT(enumerationTypes->size() == 1); > AST::NamedType& type = (*enumerationTypes)[0]; > if (is<AST::EnumerationDefinition>(type)) { > AST::EnumerationDefinition& enumerationDefinition = downcast<AST::EnumerationDefinition>(type); >- if (auto* member = enumerationDefinition.memberByName(dotExpression.fieldName())) { >+ auto memberName = dotExpression.fieldName(); >+ if (auto* member = enumerationDefinition.memberByName(memberName)) { > static_assert(sizeof(AST::EnumerationMemberLiteral) <= sizeof(AST::DotExpression), "Dot expressions need to be able to become EnumerationMemberLiterals without updating backreferences"); > Lexer::Token origin = dotExpression.origin(); > // FIXME: Perhaps do this with variants or a Rewriter instead. > dotExpression.~DotExpression(); >- new (&dotExpression) AST::EnumerationMemberLiteral(WTFMove(origin), *member); >+ auto enumerationMemberLiteral = AST::EnumerationMemberLiteral::wrap(WTFMove(origin), WTFMove(baseName), WTFMove(memberName), enumerationDefinition, *member); >+ new (&dotExpression) AST::EnumerationMemberLiteral(WTFMove(enumerationMemberLiteral)); > return; > } > setError(); >@@ -212,15 +215,18 @@ void NameResolver::visit(AST::CallExpression& callExpression) > checkErrorAndVisit(callExpression); > } > >-void NameResolver::visit(AST::ConstantExpressionEnumerationMemberReference& constantExpressionEnumerationMemberReference) >+void NameResolver::visit(AST::EnumerationMemberLiteral& enumerationMemberLiteral) > { >- if (auto enumerationTypes = m_nameContext.getTypes(constantExpressionEnumerationMemberReference.left())) { >+ if (enumerationMemberLiteral.enumerationMember()) >+ return; >+ >+ if (auto enumerationTypes = m_nameContext.getTypes(enumerationMemberLiteral.left())) { > ASSERT(enumerationTypes->size() == 1); > AST::NamedType& type = (*enumerationTypes)[0]; > if (is<AST::EnumerationDefinition>(type)) { > AST::EnumerationDefinition& enumerationDefinition = downcast<AST::EnumerationDefinition>(type); >- if (auto* member = enumerationDefinition.memberByName(constantExpressionEnumerationMemberReference.right())) { >- constantExpressionEnumerationMemberReference.setEnumerationMember(enumerationDefinition, *member); >+ if (auto* member = enumerationDefinition.memberByName(enumerationMemberLiteral.right())) { >+ enumerationMemberLiteral.setEnumerationMember(enumerationDefinition, *member); > return; > } > } >@@ -234,22 +240,22 @@ void NameResolver::visit(AST::ConstantExpressionEnumerationMemberReference& cons > bool resolveNamesInTypes(Program& program, NameResolver& nameResolver) > { > for (auto& typeDefinition : program.typeDefinitions()) { >- nameResolver.checkErrorAndVisit(static_cast<AST::TypeDefinition&>(typeDefinition)); >+ nameResolver.checkErrorAndVisit(typeDefinition); > if (nameResolver.error()) > return false; > } > for (auto& structureDefinition : program.structureDefinitions()) { >- nameResolver.checkErrorAndVisit(static_cast<AST::StructureDefinition&>(structureDefinition)); >+ nameResolver.checkErrorAndVisit(structureDefinition); > if (nameResolver.error()) > return false; > } > for (auto& enumerationDefinition : program.enumerationDefinitions()) { >- nameResolver.checkErrorAndVisit(static_cast<AST::EnumerationDefinition&>(enumerationDefinition)); >+ nameResolver.checkErrorAndVisit(enumerationDefinition); > if (nameResolver.error()) > return false; > } > for (auto& nativeTypeDeclaration : program.nativeTypeDeclarations()) { >- nameResolver.checkErrorAndVisit(static_cast<AST::NativeTypeDeclaration&>(nativeTypeDeclaration)); >+ nameResolver.checkErrorAndVisit(nativeTypeDeclaration); > if (nameResolver.error()) > return false; > } >@@ -259,14 +265,14 @@ bool resolveNamesInTypes(Program& program, NameResolver& nameResolver) > bool resolveNamesInFunctions(Program& program, NameResolver& nameResolver) > { > for (auto& functionDefinition : program.functionDefinitions()) { >- nameResolver.setCurrentFunctionDefinition(&static_cast<AST::FunctionDefinition&>(functionDefinition)); >- nameResolver.checkErrorAndVisit(static_cast<AST::FunctionDefinition&>(functionDefinition)); >+ nameResolver.setCurrentFunctionDefinition(&functionDefinition); >+ nameResolver.checkErrorAndVisit(functionDefinition); > if (nameResolver.error()) > return false; > } > nameResolver.setCurrentFunctionDefinition(nullptr); > for (auto& nativeFunctionDeclaration : program.nativeFunctionDeclarations()) { >- nameResolver.checkErrorAndVisit(static_cast<AST::FunctionDeclaration&>(nativeFunctionDeclaration)); >+ nameResolver.checkErrorAndVisit(nativeFunctionDeclaration); > if (nameResolver.error()) > return false; > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h >index c72e08e0621067dbe190ca04068a9e9a70bfdcf1..65189e2a835b6851e5e0d0aae1ca8aecaf2b37e4 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLNameResolver.h >@@ -62,7 +62,7 @@ private: > void visit(AST::PropertyAccessExpression&) override; > void visit(AST::DotExpression&) override; > void visit(AST::CallExpression&) override; >- void visit(AST::ConstantExpressionEnumerationMemberReference&) override; >+ void visit(AST::EnumerationMemberLiteral&) override; > > NameContext m_nameContext; > AST::FunctionDefinition* m_currentFunction { nullptr }; >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h >index 3cf66ced220f632a97c3a41e9d895fd5f12baf3c..5671c4513ad6ebf353aa92819b921795dcaad293 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h >@@ -39,7 +39,6 @@ > #include "WHLSLCallExpression.h" > #include "WHLSLCommaExpression.h" > #include "WHLSLConstantExpression.h" >-#include "WHLSLConstantExpressionEnumerationMemberReference.h" > #include "WHLSLContinue.h" > #include "WHLSLDereferenceExpression.h" > #include "WHLSLDoWhileLoop.h" >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLProgram.h b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLProgram.h >index c93a767f8fd94f8b2c7eb5c73e51d4b31517cc74..81510d33c98925f4984aabed0db41c0387558230 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLProgram.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLProgram.h >@@ -49,39 +49,39 @@ public: > bool append(AST::TypeDefinition&& typeDefinition) > { > m_typeDefinitions.append(makeUniqueRef<AST::TypeDefinition>(WTFMove(typeDefinition))); >- return m_nameContext.add(static_cast<AST::TypeDefinition&>(m_typeDefinitions.last())); >+ return m_nameContext.add(m_typeDefinitions.last()); > } > > bool append(AST::StructureDefinition&& structureDefinition) > { > m_structureDefinitions.append(makeUniqueRef<AST::StructureDefinition>(WTFMove(structureDefinition))); >- return m_nameContext.add(static_cast<AST::StructureDefinition&>(m_structureDefinitions.last())); >+ return m_nameContext.add(m_structureDefinitions.last()); > } > > bool append(AST::EnumerationDefinition&& enumerationDefinition) > { > m_enumerationDefinitions.append(makeUniqueRef<AST::EnumerationDefinition>(WTFMove(enumerationDefinition))); >- return m_nameContext.add(static_cast<AST::EnumerationDefinition&>(m_enumerationDefinitions.last())); >+ return m_nameContext.add(m_enumerationDefinitions.last()); > } > > bool append(AST::FunctionDefinition&& functionDefinition) > { > m_functionDefinitions.append(makeUniqueRef<AST::FunctionDefinition>(WTFMove(functionDefinition))); >- return m_nameContext.add(static_cast<AST::FunctionDefinition&>(m_functionDefinitions.last())); >+ return m_nameContext.add(m_functionDefinitions.last()); > } > > bool append(AST::NativeFunctionDeclaration&& nativeFunctionDeclaration) > { > m_nativeFunctionDeclarations.append(makeUniqueRef<AST::NativeFunctionDeclaration>(WTFMove(nativeFunctionDeclaration))); >- m_intrinsics.add(static_cast<AST::NativeFunctionDeclaration&>(m_nativeFunctionDeclarations.last())); >- return m_nameContext.add(static_cast<AST::NativeFunctionDeclaration&>(m_nativeFunctionDeclarations.last())); >+ m_intrinsics.add(m_nativeFunctionDeclarations.last()); >+ return m_nameContext.add(m_nativeFunctionDeclarations.last()); > } > > bool append(AST::NativeTypeDeclaration&& nativeTypeDeclaration) > { > m_nativeTypeDeclarations.append(makeUniqueRef<AST::NativeTypeDeclaration>(WTFMove(nativeTypeDeclaration))); >- m_intrinsics.add(static_cast<AST::NativeTypeDeclaration&>(m_nativeTypeDeclarations.last())); >- return m_nameContext.add(static_cast<AST::NativeTypeDeclaration&>(m_nativeTypeDeclarations.last())); >+ m_intrinsics.add(m_nativeTypeDeclarations.last()); >+ return m_nameContext.add(m_nativeTypeDeclarations.last()); > } > > NameContext& nameContext() { return m_nameContext; } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp >index 63fefb43dc7e059ea1e32cd928feaef6cc994610..83454834f920fd31b384393790e6160ca7c35b73 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp >@@ -28,6 +28,7 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLAddressSpace.h" > #include "WHLSLProgram.h" > #include "WHLSLTypeReference.h" > >@@ -41,8 +42,8 @@ void synthesizeEnumerationFunctions(Program& program) > bool isRestricted = false; > for (auto& enumerationDefinition : program.enumerationDefinitions()) { > { >- AST::VariableDeclaration variableDeclaration1(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), static_cast<AST::EnumerationDefinition&>(enumerationDefinition)) }, String(), WTF::nullopt, WTF::nullopt); >- AST::VariableDeclaration variableDeclaration2(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), static_cast<AST::EnumerationDefinition&>(enumerationDefinition)) }, String(), WTF::nullopt, WTF::nullopt); >+ AST::VariableDeclaration variableDeclaration1(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition) }, String(), WTF::nullopt, WTF::nullopt); >+ AST::VariableDeclaration variableDeclaration2(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition) }, String(), WTF::nullopt, WTF::nullopt); > AST::VariableDeclarations parameters; > parameters.append(WTFMove(variableDeclaration1)); > parameters.append(WTFMove(variableDeclaration2)); >@@ -50,31 +51,28 @@ void synthesizeEnumerationFunctions(Program& program) > program.append(WTFMove(nativeFunctionDeclaration)); > } > >- if (enumerationDefinition->type()) { >- // FIXME: Handle a null base type. >- { >- AST::VariableDeclaration variableDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), static_cast<AST::EnumerationDefinition&>(enumerationDefinition)) }, String(), WTF::nullopt, WTF::nullopt); >- AST::VariableDeclarations parameters; >- parameters.append(WTFMove(variableDeclaration)); >- AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type()->clone(), "operator.value"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >- program.append(WTFMove(nativeFunctionDeclaration)); >- } >+ { >+ AST::VariableDeclaration variableDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition) }, String(), WTF::nullopt, WTF::nullopt); >+ AST::VariableDeclarations parameters; >+ parameters.append(WTFMove(variableDeclaration)); >+ AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator.value"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >+ program.append(WTFMove(nativeFunctionDeclaration)); >+ } > >- { >- AST::VariableDeclaration variableDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), static_cast<AST::EnumerationDefinition&>(enumerationDefinition)) }, String(), WTF::nullopt, WTF::nullopt); >- AST::VariableDeclarations parameters; >- parameters.append(WTFMove(variableDeclaration)); >- AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type()->clone(), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >- program.append(WTFMove(nativeFunctionDeclaration)); >- } >+ { >+ AST::VariableDeclaration variableDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition) }, String(), WTF::nullopt, WTF::nullopt); >+ AST::VariableDeclarations parameters; >+ parameters.append(WTFMove(variableDeclaration)); >+ AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >+ program.append(WTFMove(nativeFunctionDeclaration)); >+ } > >- { >- AST::VariableDeclaration variableDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), enumerationDefinition->type()->clone(), String(), WTF::nullopt, WTF::nullopt); >- AST::VariableDeclarations parameters; >- parameters.append(WTFMove(variableDeclaration)); >- AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), static_cast<AST::EnumerationDefinition&>(enumerationDefinition)) }, "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >- program.append(WTFMove(nativeFunctionDeclaration)); >- } >+ { >+ AST::VariableDeclaration variableDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), enumerationDefinition->type().clone(), String(), WTF::nullopt, WTF::nullopt); >+ AST::VariableDeclarations parameters; >+ parameters.append(WTFMove(variableDeclaration)); >+ AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition) }, "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >+ program.append(WTFMove(nativeFunctionDeclaration)); > } > } > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp >index b3422ddb359b5daaf5d192d54755f6e86d797856..b99dc770b5dfcb40a5605cedfb13443dfddbda9e 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp >@@ -28,6 +28,7 @@ > > #if ENABLE(WEBGPU) > >+#include "WHLSLAddressSpace.h" > #include "WHLSLPointerType.h" > #include "WHLSLProgram.h" > #include "WHLSLReferenceType.h" >@@ -46,7 +47,7 @@ void synthesizeStructureAccessors(Program& program) > for (auto& structureElement : structureDefinition->structureElements()) { > { > // The getter: operator.field >- AST::VariableDeclaration variableDeclaration(Lexer::Token(structureElement.origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), static_cast<AST::StructureDefinition&>(structureDefinition)) }, String(), WTF::nullopt, WTF::nullopt); >+ AST::VariableDeclaration variableDeclaration(Lexer::Token(structureElement.origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), structureDefinition) }, String(), WTF::nullopt, WTF::nullopt); > AST::VariableDeclarations parameters; > parameters.append(WTFMove(variableDeclaration)); > AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, structureElement.type().clone(), String::format("operator.%s", structureElement.name().utf8().data()), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >@@ -55,18 +56,18 @@ void synthesizeStructureAccessors(Program& program) > > { > // The setter: operator.field= >- AST::VariableDeclaration variableDeclaration1(Lexer::Token(structureElement.origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), static_cast<AST::StructureDefinition&>(structureDefinition)) }, String(), WTF::nullopt, WTF::nullopt); >+ AST::VariableDeclaration variableDeclaration1(Lexer::Token(structureElement.origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), structureDefinition) }, String(), WTF::nullopt, WTF::nullopt); > AST::VariableDeclaration variableDeclaration2(Lexer::Token(structureElement.origin()), AST::Qualifiers(), { structureElement.type().clone() }, String(), WTF::nullopt, WTF::nullopt); > AST::VariableDeclarations parameters; > parameters.append(WTFMove(variableDeclaration1)); > parameters.append(WTFMove(variableDeclaration2)); >- AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), static_cast<AST::StructureDefinition&>(structureDefinition)), String::format("operator.%s=", structureElement.name().utf8().data()), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); >+ AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), structureDefinition), String::format("operator.%s=", structureElement.name().utf8().data()), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); > program.append(WTFMove(nativeFunctionDeclaration)); > } > > // The ander: operator&.field >- auto createAnder = [&](AST::ReferenceType::AddressSpace addressSpace) -> AST::NativeFunctionDeclaration { >- auto argumentType = makeUniqueRef<AST::PointerType>(Lexer::Token(structureElement.origin()), addressSpace, AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), static_cast<AST::StructureDefinition&>(structureDefinition))); >+ auto createAnder = [&](AST::AddressSpace addressSpace) -> AST::NativeFunctionDeclaration { >+ auto argumentType = makeUniqueRef<AST::PointerType>(Lexer::Token(structureElement.origin()), addressSpace, AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), structureDefinition)); > AST::VariableDeclaration variableDeclaration(Lexer::Token(structureElement.origin()), AST::Qualifiers(), { WTFMove(argumentType) }, String(), WTF::nullopt, WTF::nullopt); > AST::VariableDeclarations parameters; > parameters.append(WTFMove(variableDeclaration)); >@@ -74,10 +75,10 @@ void synthesizeStructureAccessors(Program& program) > AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String::format("operator&.%s", structureElement.name().utf8().data()), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted); > return nativeFunctionDeclaration; > }; >- program.append(createAnder(AST::ReferenceType::AddressSpace::Constant)); >- program.append(createAnder(AST::ReferenceType::AddressSpace::Device)); >- program.append(createAnder(AST::ReferenceType::AddressSpace::Threadgroup)); >- program.append(createAnder(AST::ReferenceType::AddressSpace::Thread)); >+ program.append(createAnder(AST::AddressSpace::Constant)); >+ program.append(createAnder(AST::AddressSpace::Device)); >+ program.append(createAnder(AST::AddressSpace::Threadgroup)); >+ program.append(createAnder(AST::AddressSpace::Thread)); > } > } > } >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.cpp b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.cpp >index 7fd3675aa3a1b37c296a32c95cee82dadf69a48b..52d2e8fccb474a90e0e3452d015e5c6b39f405b5 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.cpp >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.cpp >@@ -40,7 +40,6 @@ > #include "WHLSLCallExpression.h" > #include "WHLSLCommaExpression.h" > #include "WHLSLConstantExpression.h" >-#include "WHLSLConstantExpressionEnumerationMemberReference.h" > #include "WHLSLContinue.h" > #include "WHLSLDereferenceExpression.h" > #include "WHLSLDoWhileLoop.h" >@@ -48,6 +47,7 @@ > #include "WHLSLEffectfulExpressionStatement.h" > #include "WHLSLEnumerationDefinition.h" > #include "WHLSLEnumerationMember.h" >+#include "WHLSLEnumerationMemberLiteral.h" > #include "WHLSLExpression.h" > #include "WHLSLFallthrough.h" > #include "WHLSLFloatLiteral.h" >@@ -104,17 +104,17 @@ void Visitor::visit(Program& program) > { > // These visiting functions might add new global statements, so don't use foreach syntax. > for (size_t i = 0; i < program.typeDefinitions().size(); ++i) >- checkErrorAndVisit(static_cast<AST::TypeDefinition&>(program.typeDefinitions()[i])); >+ checkErrorAndVisit(program.typeDefinitions()[i]); > for (size_t i = 0; i < program.structureDefinitions().size(); ++i) >- checkErrorAndVisit(static_cast<AST::StructureDefinition&>(program.structureDefinitions()[i])); >+ checkErrorAndVisit(program.structureDefinitions()[i]); > for (size_t i = 0; i < program.enumerationDefinitions().size(); ++i) >- checkErrorAndVisit(static_cast<AST::EnumerationDefinition&>(program.enumerationDefinitions()[i])); >+ checkErrorAndVisit(program.enumerationDefinitions()[i]); > for (size_t i = 0; i < program.functionDefinitions().size(); ++i) >- checkErrorAndVisit(static_cast<AST::FunctionDefinition&>(program.functionDefinitions()[i])); >+ checkErrorAndVisit(program.functionDefinitions()[i]); > for (size_t i = 0; i < program.nativeFunctionDeclarations().size(); ++i) >- checkErrorAndVisit(static_cast<AST::NativeFunctionDeclaration&>(program.nativeFunctionDeclarations()[i])); >+ checkErrorAndVisit(program.nativeFunctionDeclarations()[i]); > for (size_t i = 0; i < program.nativeTypeDeclarations().size(); ++i) >- checkErrorAndVisit(static_cast<AST::NativeTypeDeclaration&>(program.nativeTypeDeclarations()[i])); >+ checkErrorAndVisit(program.nativeTypeDeclarations()[i]); > } > > void Visitor::visit(AST::UnnamedType& unnamedType) >@@ -158,8 +158,7 @@ void Visitor::visit(AST::StructureDefinition& structureDefinition) > > void Visitor::visit(AST::EnumerationDefinition& enumerationDefinition) > { >- if (enumerationDefinition.type()) >- checkErrorAndVisit(static_cast<AST::UnnamedType&>(*enumerationDefinition.type())); >+ checkErrorAndVisit(enumerationDefinition.type()); > for (auto& enumerationMember : enumerationDefinition.enumerationMembers()) > checkErrorAndVisit(enumerationMember); > } >@@ -234,7 +233,7 @@ void Visitor::visit(AST::TypeArgument& typeArgument) > WTF::visit(WTF::makeVisitor([&](AST::ConstantExpression& constantExpression) { > checkErrorAndVisit(constantExpression); > }, [&](UniqueRef<AST::TypeReference>& typeReference) { >- checkErrorAndVisit(static_cast<AST::TypeReference&>(typeReference)); >+ checkErrorAndVisit(typeReference); > }), typeArgument); > } > >@@ -268,8 +267,8 @@ void Visitor::visit(AST::ConstantExpression& constantExpression) > checkErrorAndVisit(nullLiteral); > }, [&](AST::BooleanLiteral& booleanLiteral) { > checkErrorAndVisit(booleanLiteral); >- }, [&](AST::ConstantExpressionEnumerationMemberReference& constantExpressionEnumerationMemberReference) { >- checkErrorAndVisit(constantExpressionEnumerationMemberReference); >+ }, [&](AST::EnumerationMemberLiteral& enumerationMemberLiteral) { >+ checkErrorAndVisit(enumerationMemberLiteral); > })); > } > >@@ -346,7 +345,7 @@ void Visitor::visit(AST::NullLiteralType& nullLiteralType) > checkErrorAndVisit(*nullLiteralType.resolvedType()); > } > >-void Visitor::visit(AST::ConstantExpressionEnumerationMemberReference&) >+void Visitor::visit(AST::EnumerationMemberLiteral&) > { > } > >@@ -364,7 +363,7 @@ void Visitor::visit(AST::NumThreadsFunctionAttribute&) > void Visitor::visit(AST::Block& block) > { > for (auto& statement : block.statements()) >- checkErrorAndVisit(static_cast<AST::Statement&>(statement)); >+ checkErrorAndVisit(statement); > } > > void Visitor::visit(AST::Statement& statement) >@@ -451,6 +450,8 @@ void Visitor::visit(AST::Expression& expression) > checkErrorAndVisit(downcast<AST::TernaryExpression>(expression)); > else if (is<AST::UnsignedIntegerLiteral>(expression)) > checkErrorAndVisit(downcast<AST::UnsignedIntegerLiteral>(expression)); >+ else if (is<AST::EnumerationMemberLiteral>(expression)) >+ checkErrorAndVisit(downcast<AST::EnumerationMemberLiteral>(expression)); > else { > ASSERT(is<AST::VariableReference>(expression)); > checkErrorAndVisit(downcast<AST::VariableReference>(expression)); >@@ -487,7 +488,7 @@ void Visitor::visit(AST::ForLoop& forLoop) > WTF::visit(WTF::makeVisitor([&](AST::VariableDeclarationsStatement& variableDeclarationsStatement) { > checkErrorAndVisit(variableDeclarationsStatement); > }, [&](UniqueRef<AST::Expression>& expression) { >- checkErrorAndVisit(static_cast<AST::Expression&>(expression)); >+ checkErrorAndVisit(expression); > }), forLoop.initialization()); > if (forLoop.condition()) > checkErrorAndVisit(*forLoop.condition()); >@@ -501,7 +502,7 @@ void Visitor::visit(AST::IfStatement& ifStatement) > checkErrorAndVisit(ifStatement.conditional()); > checkErrorAndVisit(ifStatement.body()); > if (ifStatement.elseBody()) >- checkErrorAndVisit(static_cast<AST::Statement&>(*ifStatement.elseBody())); >+ checkErrorAndVisit(*ifStatement.elseBody()); > } > > void Visitor::visit(AST::Return& returnStatement) >@@ -559,7 +560,7 @@ void Visitor::visit(AST::AssignmentExpression& assignmentExpression) > void Visitor::visit(AST::CallExpression& callExpression) > { > for (auto& argument : callExpression.arguments()) >- checkErrorAndVisit(static_cast<AST::Expression&>(argument)); >+ checkErrorAndVisit(argument); > if (callExpression.castReturnType()) > checkErrorAndVisit(callExpression.castReturnType()->get()); > } >@@ -567,7 +568,7 @@ void Visitor::visit(AST::CallExpression& callExpression) > void Visitor::visit(AST::CommaExpression& commaExpression) > { > for (auto& expression : commaExpression.list()) >- checkErrorAndVisit(static_cast<AST::Expression&>(expression)); >+ checkErrorAndVisit(expression); > } > > void Visitor::visit(AST::DereferenceExpression& dereferenceExpression) >diff --git a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.h b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.h >index a6ae293a9b836d15aa167b7d409fb2a6e645b43c..a5e4c96d8a01c231382d06e7a39f61c6b2e3bce3 100644 >--- a/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.h >+++ b/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.h >@@ -63,7 +63,7 @@ class UnsignedIntegerLiteral; > class FloatLiteral; > class NullLiteral; > class BooleanLiteral; >-class ConstantExpressionEnumerationMemberReference; >+class EnumerationMemberLiteral; > class NumThreadsFunctionAttribute; > class Block; > class Statement; >@@ -141,7 +141,7 @@ public: > virtual void visit(AST::UnsignedIntegerLiteralType&); > virtual void visit(AST::FloatLiteralType&); > virtual void visit(AST::NullLiteralType&); >- virtual void visit(AST::ConstantExpressionEnumerationMemberReference&); >+ virtual void visit(AST::EnumerationMemberLiteral&); > virtual void visit(AST::FunctionAttribute&); > virtual void visit(AST::NumThreadsFunctionAttribute&); > virtual void visit(AST::Block&); >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 6493844b88d5064341250b4ddd5fc05135b87777..f2f515a4e43e519f4f349474e71492539bf848fc 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -6406,7 +6406,6 @@ > 1C24EEA71C72A7B40080F8FC /* JSFontFaceSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSFontFaceSet.h; path = DerivedSources/WebCore/JSFontFaceSet.h; sourceTree = BUILT_PRODUCTS_DIR; }; > 1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoaderMac.cpp; sourceTree = "<group>"; }; > 1C3249101C6D6A3B007EDB32 /* FontVariantBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontVariantBuilder.cpp; sourceTree = "<group>"; }; >- 1C33276C21CEDA42000DC9F2 /* WHLSLEnumerationMemberLiteral.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLEnumerationMemberLiteral.h; sourceTree = "<group>"; }; > 1C33277121CF0BE1000DC9F2 /* WHLSLNamedType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLNamedType.h; sourceTree = "<group>"; }; > 1C33277221CF0D2E000DC9F2 /* WHLSLUnnamedType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLUnnamedType.h; sourceTree = "<group>"; }; > 1C3969CF1B74211E002BCFA7 /* FontCacheCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontCacheCoreText.cpp; sourceTree = "<group>"; }; >@@ -6415,6 +6414,8 @@ > 1C81B9560E97330800266E07 /* InspectorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorController.h; sourceTree = "<group>"; }; > 1C81B9570E97330800266E07 /* InspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorController.cpp; sourceTree = "<group>"; }; > 1C81B9580E97330800266E07 /* InspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorClient.h; sourceTree = "<group>"; }; >+ 1C840B7D21EBE0B800D0500D /* WHLSLEntryPointType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLEntryPointType.h; sourceTree = "<group>"; }; >+ 1C840B9021EC30F900D0500D /* WHLSLAddressSpace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLAddressSpace.h; sourceTree = "<group>"; }; > 1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; }; > 1CA19E030DC255950065A994 /* EventLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventLoopMac.mm; sourceTree = "<group>"; }; > 1CA19E150DC255CA0065A994 /* EventLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventLoop.h; sourceTree = "<group>"; }; >@@ -13267,7 +13268,7 @@ > C21BF6FF21CD89C200227979 /* WHLSLIfStatement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLIfStatement.h; sourceTree = "<group>"; }; > C21BF70021CD89C200227979 /* WHLSLFallthrough.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLFallthrough.h; sourceTree = "<group>"; }; > C21BF70121CD89C400227979 /* WHLSLDereferenceExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLDereferenceExpression.h; sourceTree = "<group>"; }; >- C21BF70221CD89C400227979 /* WHLSLConstantExpressionEnumerationMemberReference.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLConstantExpressionEnumerationMemberReference.h; sourceTree = "<group>"; }; >+ C21BF70221CD89C400227979 /* WHLSLEnumerationMemberLiteral.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLEnumerationMemberLiteral.h; sourceTree = "<group>"; }; > C21BF70321CD89C500227979 /* WHLSLReturn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLReturn.h; sourceTree = "<group>"; }; > C21BF70421CD89C600227979 /* WHLSLWhileLoop.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLWhileLoop.h; sourceTree = "<group>"; }; > C21BF70521CD89C700227979 /* WHLSLFunctionAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLFunctionAttribute.h; sourceTree = "<group>"; }; >@@ -13323,6 +13324,10 @@ > C21BF73A21CD8D7000227979 /* WHLSLProgram.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLProgram.h; sourceTree = "<group>"; }; > C21BF74221CD963B00227979 /* WHLSLStandardLibrary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WHLSLStandardLibrary.h; path = DerivedSources/WebCore/WHLSLStandardLibrary.h; sourceTree = BUILT_PRODUCTS_DIR; }; > C21BF74521CD969800227979 /* WHLSLStandardLibrary.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = WHLSLStandardLibrary.txt; sourceTree = "<group>"; }; >+ C21DF2E71D9E4E9900F5B24C /* CSSFontVariationValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontVariationValue.cpp; sourceTree = "<group>"; }; >+ C21DF2E81D9E4E9900F5B24C /* CSSFontVariationValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontVariationValue.h; sourceTree = "<group>"; }; >+ C234A98521E886A9003C984D /* WHLSLVisitor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLVisitor.cpp; sourceTree = "<group>"; }; >+ C234A98721E886AD003C984D /* WHLSLVisitor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLVisitor.h; sourceTree = "<group>"; }; > C234A98A21E8883E003C984D /* WHLSLNameResolver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLNameResolver.cpp; sourceTree = "<group>"; }; > C234A98C21E8883E003C984D /* WHLSLNameResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLNameResolver.h; sourceTree = "<group>"; }; > C234A98D21E88884003C984D /* WHLSLNameContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLNameContext.cpp; sourceTree = "<group>"; }; >@@ -13346,10 +13351,6 @@ > C234A9B521E92C23003C984D /* WHLSLSynthesizeStructureAccessors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLSynthesizeStructureAccessors.h; sourceTree = "<group>"; }; > C234A9B621E92CC0003C984D /* WHLSLIntrinsics.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLIntrinsics.h; sourceTree = "<group>"; }; > C234A9B721E92CC1003C984D /* WHLSLIntrinsics.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLIntrinsics.cpp; sourceTree = "<group>"; }; >- C21DF2E71D9E4E9900F5B24C /* CSSFontVariationValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontVariationValue.cpp; sourceTree = "<group>"; }; >- C21DF2E81D9E4E9900F5B24C /* CSSFontVariationValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontVariationValue.h; sourceTree = "<group>"; }; >- C234A98521E886A9003C984D /* WHLSLVisitor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLVisitor.cpp; sourceTree = "<group>"; }; >- C234A98721E886AD003C984D /* WHLSLVisitor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLVisitor.h; sourceTree = "<group>"; }; > C2458E611FE8979E00594759 /* FontCacheCoreText.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontCacheCoreText.h; sourceTree = "<group>"; }; > C26017A11C72DC9900F74A16 /* CSSFontFaceSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSFontFaceSet.cpp; sourceTree = "<group>"; }; > C26017A21C72DC9900F74A16 /* CSSFontFaceSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFaceSet.h; sourceTree = "<group>"; }; >@@ -25451,6 +25452,7 @@ > C21BF6F121CD898D00227979 /* AST */ = { > isa = PBXGroup; > children = ( >+ 1C840B9021EC30F900D0500D /* WHLSLAddressSpace.h */, > C21BF72521CD89E200227979 /* WHLSLArrayReferenceType.h */, > C21BF70921CD89CA00227979 /* WHLSLArrayType.h */, > C21BF73021CD89ED00227979 /* WHLSLAssignmentExpression.h */, >@@ -25464,15 +25466,15 @@ > C21BF71621CD89D500227979 /* WHLSLCallExpression.h */, > C21BF70621CD89C700227979 /* WHLSLCommaExpression.h */, > C21BF73321CD89F000227979 /* WHLSLConstantExpression.h */, >- C21BF70221CD89C400227979 /* WHLSLConstantExpressionEnumerationMemberReference.h */, > C21BF6F521CD89B500227979 /* WHLSLContinue.h */, > C21BF70121CD89C400227979 /* WHLSLDereferenceExpression.h */, > C21BF71821CD89D700227979 /* WHLSLDotExpression.h */, > C21BF6FB21CD89BE00227979 /* WHLSLDoWhileLoop.h */, > C21BF72821CD89E500227979 /* WHLSLEffectfulExpressionStatement.h */, >+ 1C840B7D21EBE0B800D0500D /* WHLSLEntryPointType.h */, > C21BF72021CD89DD00227979 /* WHLSLEnumerationDefinition.h */, > C21BF72621CD89E300227979 /* WHLSLEnumerationMember.h */, >- 1C33276C21CEDA42000DC9F2 /* WHLSLEnumerationMemberLiteral.h */, >+ C21BF70221CD89C400227979 /* WHLSLEnumerationMemberLiteral.h */, > C21BF70C21CD89CC00227979 /* WHLSLExpression.h */, > C21BF70021CD89C200227979 /* WHLSLFallthrough.h */, > C21BF73521CD89F200227979 /* WHLSLFloatLiteral.h */,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193389
:
359011
| 359017