Title: [240097] trunk/Source/WebCore
Revision
240097
Author
[email protected]
Date
2019-01-16 16:59:15 -0800 (Wed, 16 Jan 2019)

Log Message

[WHLSL] Delete the 'restricted' keyword
https://bugs.webkit.org/show_bug.cgi?id=193469

Reviewed by Dean Jackson and Robin Morisset.

This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.

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

* Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
(WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
(WebCore::WHLSL::AST::FunctionDefinition::block):
(WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
(WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
(WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
(WebCore::WHLSL::resolveFunctionOverloadImpl):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240096 => 240097)


--- trunk/Source/WebCore/ChangeLog	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/ChangeLog	2019-01-17 00:59:15 UTC (rev 240097)
@@ -1,5 +1,39 @@
 2019-01-16  Myles C. Maxfield  <[email protected]>
 
+        [WHLSL] Delete the 'restricted' keyword
+        https://bugs.webkit.org/show_bug.cgi?id=193469
+
+        Reviewed by Dean Jackson and Robin Morisset.
+
+        This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.
+
+        No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
+        of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
+
+        * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
+        (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
+        (WebCore::WHLSL::AST::FunctionDefinition::block):
+        (WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
+        * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
+        (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
+        (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
+        * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
+        (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
+        (WebCore::WHLSL::resolveWithOperatorLength):
+        (WebCore::WHLSL::resolveWithReferenceComparator):
+        * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
+        (WebCore::WHLSL::resolveFunctionOverloadImpl):
+        * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
+        (WebCore::WHLSL::synthesizeArrayOperatorLength):
+        * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
+        (WebCore::WHLSL::synthesizeConstructors):
+        * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
+        (WebCore::WHLSL::synthesizeEnumerationFunctions):
+        * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
+        (WebCore::WHLSL::synthesizeStructureAccessors):
+
+2019-01-16  Myles C. Maxfield  <[email protected]>
+
         [WHLSL] Implement the recursion checker
         https://bugs.webkit.org/show_bug.cgi?id=193436
 

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h	2019-01-17 00:59:15 UTC (rev 240097)
@@ -38,10 +38,9 @@
 
 class FunctionDefinition : public FunctionDeclaration {
 public:
-    FunctionDefinition(FunctionDeclaration&& functionDeclaration, Block&& block, bool restricted)
+    FunctionDefinition(FunctionDeclaration&& functionDeclaration, Block&& block)
         : FunctionDeclaration(WTFMove(functionDeclaration))
         , m_block(WTFMove(block))
-        , m_restricted(restricted)
     {
     }
 
@@ -53,11 +52,9 @@
     bool isFunctionDefinition() const override { return true; }
 
     Block& block() { return m_block; }
-    bool restricted() const { return m_restricted; }
 
 private:
     Block m_block;
-    bool m_restricted;
 };
 
 } // namespace AST

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h	2019-01-17 00:59:15 UTC (rev 240097)
@@ -37,9 +37,8 @@
 
 class NativeFunctionDeclaration : public FunctionDeclaration {
 public:
-    NativeFunctionDeclaration(FunctionDeclaration&& functionDeclaration, bool restricted)
+    NativeFunctionDeclaration(FunctionDeclaration&& functionDeclaration)
         : FunctionDeclaration(WTFMove(functionDeclaration))
-        , m_restricted(restricted)
     {
     }
 
@@ -50,10 +49,7 @@
 
     bool isNativeFunctionDeclaration() const override { return true; }
 
-    bool restricted() const { return m_restricted; }
-
 private:
-    bool m_restricted;
 };
 
 } // namespace AST

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp	2019-01-17 00:59:15 UTC (rev 240097)
@@ -119,28 +119,25 @@
 
 static AST::NativeFunctionDeclaration resolveWithOperatorAnderIndexer(AST::CallExpression& callExpression, AST::ArrayReferenceType& firstArgument, const Intrinsics& intrinsics)
 {
-    const bool isRestricted = false;
     const bool isOperator = true;
     auto returnType = makeUniqueRef<AST::PointerType>(Lexer::Token(callExpression.origin()), firstArgument.addressSpace(), firstArgument.elementType().clone());
     AST::VariableDeclarations parameters;
     parameters.append(AST::VariableDeclaration(Lexer::Token(callExpression.origin()), AST::Qualifiers(), { firstArgument.clone() }, String(), WTF::nullopt, WTF::nullopt));
     parameters.append(AST::VariableDeclaration(Lexer::Token(callExpression.origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(callExpression.origin()), intrinsics.uintType()) }, String(), WTF::nullopt, WTF::nullopt));
-    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(callExpression.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator&[]", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(callExpression.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator&[]", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator));
 }
 
 static AST::NativeFunctionDeclaration resolveWithOperatorLength(AST::CallExpression& callExpression, AST::UnnamedType& firstArgument, const Intrinsics& intrinsics)
 {
-    const bool isRestricted = false;
     const bool isOperator = true;
     auto returnType = AST::TypeReference::wrap(Lexer::Token(callExpression.origin()), intrinsics.uintType());
     AST::VariableDeclarations parameters;
     parameters.append(AST::VariableDeclaration(Lexer::Token(callExpression.origin()), AST::Qualifiers(), { firstArgument.clone() }, String(), WTF::nullopt, WTF::nullopt));
-    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(callExpression.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator.length", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(callExpression.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator.length", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator));
 }
 
 static AST::NativeFunctionDeclaration resolveWithReferenceComparator(AST::CallExpression& callExpression, ResolvingType& firstArgument, ResolvingType& secondArgument, const Intrinsics& intrinsics)
 {
-    const bool isRestricted = false;
     const bool isOperator = true;
     auto returnType = AST::TypeReference::wrap(Lexer::Token(callExpression.origin()), intrinsics.boolType());
     auto argumentType = WTF::visit(WTF::makeVisitor([](UniqueRef<AST::UnnamedType>& unnamedType) -> UniqueRef<AST::UnnamedType> {
@@ -158,7 +155,7 @@
     AST::VariableDeclarations parameters;
     parameters.append(AST::VariableDeclaration(Lexer::Token(callExpression.origin()), AST::Qualifiers(), { argumentType->clone() }, String(), WTF::nullopt, WTF::nullopt));
     parameters.append(AST::VariableDeclaration(Lexer::Token(callExpression.origin()), AST::Qualifiers(), { WTFMove(argumentType) }, String(), WTF::nullopt, WTF::nullopt));
-    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(callExpression.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator==", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(callExpression.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator==", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator));
 }
 
 static Optional<AST::NativeFunctionDeclaration> resolveByInstantiation(AST::CallExpression& callExpression, const Vector<std::reference_wrapper<ResolvingType>>& types, const Intrinsics& intrinsics)

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp	2019-01-17 00:59:15 UTC (rev 240097)
@@ -1096,8 +1096,6 @@
 
 auto Parser::parseFunctionDefinition() -> Expected<AST::FunctionDefinition, Error>
 {
-    bool restricted = static_cast<bool>(tryType(Lexer::Token::Type::Restricted));
-
     auto functionDeclaration = parseFunctionDeclaration();
     if (!functionDeclaration)
         return Unexpected<Error>(functionDeclaration.error());
@@ -1106,7 +1104,7 @@
     if (!block)
         return Unexpected<Error>(block.error());
 
-    return AST::FunctionDefinition(WTFMove(*functionDeclaration), WTFMove(*block), restricted);
+    return AST::FunctionDefinition(WTFMove(*functionDeclaration), WTFMove(*block));
 }
 
 auto Parser::parseEntryPointFunctionDeclaration() -> Expected<AST::FunctionDeclaration, Error>
@@ -1249,12 +1247,6 @@
 {
     Optional<Lexer::Token> origin;
 
-    bool restricted = false;
-    if (auto restrictedValue = tryType(Lexer::Token::Type::Restricted)) {
-        origin = *restrictedValue;
-        restricted = true;
-    }
-
     auto native = consumeType(Lexer::Token::Type::Native);
     if (!native)
         return Unexpected<Error>(native.error());
@@ -1269,7 +1261,7 @@
     if (!semicolon)
         return Unexpected<Error>(semicolon.error());
 
-    return AST::NativeFunctionDeclaration(WTFMove(*functionDeclaration), restricted);
+    return AST::NativeFunctionDeclaration(WTFMove(*functionDeclaration));
 }
 
 auto Parser::parseBlock() -> Expected<AST::Block, Error>

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp	2019-01-17 00:59:15 UTC (rev 240097)
@@ -71,25 +71,8 @@
             minimumCostCandidates.append(candidate);
     }
 
-    bool restrictedCandidateExists = false;
-    for (auto& candidate : minimumCostCandidates) {
-        if (is<AST::FunctionDefinition>(candidate.get()) && downcast<AST::FunctionDefinition>(candidate.get()).restricted()) {
-            restrictedCandidateExists = true;
-            break;
-        }
-    }
-
-    candidates.clear();
-    if (restrictedCandidateExists) {
-        for (auto& candidate : minimumCostCandidates) {
-            if (is<AST::FunctionDefinition>(candidate.get()) && downcast<AST::FunctionDefinition>(candidate.get()).restricted())
-                candidates.append(candidate.get());
-        }
-    } else
-        candidates = minimumCostCandidates;
-
-    if (candidates.size() == 1)
-        return &candidates[0].get();
+    if (minimumCostCandidates.size() == 1)
+        return &minimumCostCandidates[0].get();
     return nullptr;
 }
 

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp	2019-01-17 00:59:15 UTC (rev 240097)
@@ -63,13 +63,12 @@
     auto arrayTypes = findArrayTypes.takeArrayTypes();
 
     bool isOperator = true;
-    bool isRestricted = false;
 
     for (auto& arrayType : arrayTypes) {
         AST::VariableDeclaration variableDeclaration(Lexer::Token(arrayType.get().origin()), AST::Qualifiers(), { arrayType.get().clone() }, String(), WTF::nullopt, WTF::nullopt);
         AST::VariableDeclarations parameters;
         parameters.append(WTFMove(variableDeclaration));
-        AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(arrayType.get().origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(arrayType.get().origin()), program.intrinsics().uintType()), "operator.length"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+        AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(arrayType.get().origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(arrayType.get().origin()), program.intrinsics().uintType()), "operator.length"_str, WTFMove(parameters), WTF::nullopt, isOperator));
         program.append(WTFMove(nativeFunctionDeclaration));
     }
 }

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp	2019-01-17 00:59:15 UTC (rev 240097)
@@ -101,16 +101,15 @@
     auto m_namedTypes = findAllTypes.takeNamedTypes();
 
     bool isOperator = true;
-    bool isRestricted = false;
 
     for (auto& unnamedType : m_unnamedTypes) {
         AST::VariableDeclaration variableDeclaration(Lexer::Token(unnamedType.get().origin()), AST::Qualifiers(), { unnamedType.get().clone() }, String(), WTF::nullopt, WTF::nullopt);
         AST::VariableDeclarations parameters;
         parameters.append(WTFMove(variableDeclaration));
-        AST::NativeFunctionDeclaration copyConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.get().clone(), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+        AST::NativeFunctionDeclaration copyConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.get().clone(), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator));
         program.append(WTFMove(copyConstructor));
 
-        AST::NativeFunctionDeclaration defaultConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.get().clone(), "operator cast"_str, AST::VariableDeclarations(), WTF::nullopt, isOperator), isRestricted);
+        AST::NativeFunctionDeclaration defaultConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.get().clone(), "operator cast"_str, AST::VariableDeclarations(), WTF::nullopt, isOperator));
         program.append(WTFMove(defaultConstructor));
     }
 
@@ -118,10 +117,10 @@
         AST::VariableDeclaration variableDeclaration(Lexer::Token(namedType.get().origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(namedType.get().origin()), namedType.get()) }, String(), WTF::nullopt, WTF::nullopt);
         AST::VariableDeclarations parameters;
         parameters.append(WTFMove(variableDeclaration));
-        AST::NativeFunctionDeclaration copyConstructor(AST::FunctionDeclaration(Lexer::Token(namedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(namedType.get().origin()), namedType.get()), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+        AST::NativeFunctionDeclaration copyConstructor(AST::FunctionDeclaration(Lexer::Token(namedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(namedType.get().origin()), namedType.get()), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator));
         program.append(WTFMove(copyConstructor));
 
-        AST::NativeFunctionDeclaration defaultConstructor(AST::FunctionDeclaration(Lexer::Token(namedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(namedType.get().origin()), namedType.get()), "operator cast"_str, AST::VariableDeclarations(), WTF::nullopt, isOperator), isRestricted);
+        AST::NativeFunctionDeclaration defaultConstructor(AST::FunctionDeclaration(Lexer::Token(namedType.get().origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(namedType.get().origin()), namedType.get()), "operator cast"_str, AST::VariableDeclarations(), WTF::nullopt, isOperator));
         program.append(WTFMove(defaultConstructor));
     }
 }

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp	2019-01-17 00:59:15 UTC (rev 240097)
@@ -39,7 +39,6 @@
 void synthesizeEnumerationFunctions(Program& program)
 {
     bool isOperator = true;
-    bool isRestricted = false;
     for (auto& enumerationDefinition : program.enumerationDefinitions()) {
         {
             AST::VariableDeclaration variableDeclaration1(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), { AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition) }, String(), WTF::nullopt, WTF::nullopt);
@@ -47,7 +46,7 @@
             AST::VariableDeclarations parameters;
             parameters.append(WTFMove(variableDeclaration1));
             parameters.append(WTFMove(variableDeclaration2));
-            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), program.intrinsics().boolType()), "operator=="_str, WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), program.intrinsics().boolType()), "operator=="_str, WTFMove(parameters), WTF::nullopt, isOperator));
             program.append(WTFMove(nativeFunctionDeclaration));
         }
 
@@ -55,7 +54,7 @@
             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);
+            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator.value"_str, WTFMove(parameters), WTF::nullopt, isOperator));
             program.append(WTFMove(nativeFunctionDeclaration));
         }
 
@@ -63,7 +62,7 @@
             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);
+            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator));
             program.append(WTFMove(nativeFunctionDeclaration));
         }
 
@@ -71,7 +70,7 @@
             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);
+            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));
             program.append(WTFMove(nativeFunctionDeclaration));
         }
     }

Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp (240096 => 240097)


--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp	2019-01-17 00:53:40 UTC (rev 240096)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp	2019-01-17 00:59:15 UTC (rev 240097)
@@ -42,7 +42,6 @@
 void synthesizeStructureAccessors(Program& program)
 {
     bool isOperator = true;
-    bool isRestricted = false;
     for (auto& structureDefinition : program.structureDefinitions()) {
         for (auto& structureElement : structureDefinition->structureElements()) {
             {
@@ -50,7 +49,7 @@
                 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(), makeString("operator.", structureElement.name()), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+                AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, structureElement.type().clone(), makeString("operator.", structureElement.name()), WTFMove(parameters), WTF::nullopt, isOperator));
                 program.append(WTFMove(nativeFunctionDeclaration));
             }
 
@@ -61,7 +60,7 @@
                 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()), structureDefinition), makeString("operator.", structureElement.name(), '='), 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), makeString("operator.", structureElement.name(), '='), WTFMove(parameters), WTF::nullopt, isOperator));
                 program.append(WTFMove(nativeFunctionDeclaration));
             }
 
@@ -72,7 +71,7 @@
                 AST::VariableDeclarations parameters;
                 parameters.append(WTFMove(variableDeclaration));
                 auto returnType = makeUniqueRef<AST::PointerType>(Lexer::Token(structureElement.origin()), addressSpace, structureElement.type().clone());
-                AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), makeString("operator&.", structureElement.name()), WTFMove(parameters), WTF::nullopt, isOperator), isRestricted);
+                AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), makeString("operator&.", structureElement.name()), WTFMove(parameters), WTF::nullopt, isOperator));
                 return nativeFunctionDeclaration;
             };
             program.append(createAnder(AST::AddressSpace::Constant));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to