<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[247110] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/247110">247110</a></dd>
<dt>Author</dt> <dd>rmorisset@apple.com</dd>
<dt>Date</dt> <dd>2019-07-03 15:11:36 -0700 (Wed, 03 Jul 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WHLSL] "Semantic" should be held by a unique_ptr, not an Optional
https://bugs.webkit.org/show_bug.cgi?id=199462

Reviewed by Myles C. Maxfield.

Most StructureElement, FunctionDeclaration and (especially) VariableDeclaration don't have a 'Semantic' field.
Using an Optional<Semantic> to represent this is a major memory waste, as Semantic is 56 bytes, so Optional<Semantic> is 64 bytes!
Putting one level of indirection through a unique_ptr thus saves 56 bytes for each VariableDeclaration (and FunctionDeclaration and StructureElement) that does not have a Semantic,
at the low cost of one pointer dereference when accessing the field for those that have one.

This patch also reorders the fields of FunctionDefinition to save another 8 bytes.

No new tests as there is no intended functional change.

* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
(WebCore::WHLSL::AST::FunctionDeclaration::semantic):
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
(WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
(WebCore::WHLSL::AST::StructureElement::StructureElement):
(WebCore::WHLSL::AST::StructureElement::semantic):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
(WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
(WebCore::WHLSL::AST::VariableDeclaration::semantic):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
(WebCore::WHLSL::Gatherer::visit):
(WebCore::WHLSL::gatherEntryPointItems):
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::parseSemantic):
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
(WebCore::WHLSL::preserveVariableLifetimes):
* Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
(WebCore::WHLSL::wrapAnderCallArgument):
(WebCore::WHLSL::modify):
(WebCore::WHLSL::PropertyResolver::visit):
* 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):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLFunctionDeclarationh">trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLReadModifyWriteExpressionh">trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLStructureElementh">trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLVariableDeclarationh">trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLCheckercpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLGatherEntryPointItemscpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLParsercpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLParserh">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLPreserveVariableLifetimescpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLPropertyResolvercpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeArrayOperatorLengthcpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeConstructorscpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeEnumerationFunctionscpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeStructureAccessorscpp">trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/ChangeLog      2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -1,5 +1,57 @@
</span><span class="cx"> 2019-07-03  Robin Morisset  <rmorisset@apple.com>
</span><span class="cx"> 
</span><ins>+        [WHLSL] "Semantic" should be held by a unique_ptr, not an Optional
+        https://bugs.webkit.org/show_bug.cgi?id=199462
+
+        Reviewed by Myles C. Maxfield.
+
+        Most StructureElement, FunctionDeclaration and (especially) VariableDeclaration don't have a 'Semantic' field.
+        Using an Optional<Semantic> to represent this is a major memory waste, as Semantic is 56 bytes, so Optional<Semantic> is 64 bytes!
+        Putting one level of indirection through a unique_ptr thus saves 56 bytes for each VariableDeclaration (and FunctionDeclaration and StructureElement) that does not have a Semantic,
+        at the low cost of one pointer dereference when accessing the field for those that have one.
+
+        This patch also reorders the fields of FunctionDefinition to save another 8 bytes.
+
+        No new tests as there is no intended functional change.
+
+        * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
+        (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
+        (WebCore::WHLSL::AST::FunctionDeclaration::semantic):
+        * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
+        (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
+        * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
+        (WebCore::WHLSL::AST::StructureElement::StructureElement):
+        (WebCore::WHLSL::AST::StructureElement::semantic):
+        * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
+        (WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
+        (WebCore::WHLSL::AST::VariableDeclaration::semantic):
+        * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
+        (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
+        (WebCore::WHLSL::resolveWithOperatorLength):
+        (WebCore::WHLSL::resolveWithReferenceComparator):
+        * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
+        (WebCore::WHLSL::Gatherer::visit):
+        (WebCore::WHLSL::gatherEntryPointItems):
+        * Modules/webgpu/WHLSL/WHLSLParser.cpp:
+        (WebCore::WHLSL::Parser::parseSemantic):
+        * Modules/webgpu/WHLSL/WHLSLParser.h:
+        * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
+        (WebCore::WHLSL::preserveVariableLifetimes):
+        * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
+        (WebCore::WHLSL::wrapAnderCallArgument):
+        (WebCore::WHLSL::modify):
+        (WebCore::WHLSL::PropertyResolver::visit):
+        * 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-07-03  Robin Morisset  <rmorisset@apple.com>
+
</ins><span class="cx">         [WHLSL] WHLSL::AST::Node is useless
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=199391
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLFunctionDeclarationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h 2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h    2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -44,15 +44,15 @@
</span><span class="cx"> 
</span><span class="cx"> class FunctionDeclaration {
</span><span class="cx"> public:
</span><del>-    FunctionDeclaration(Lexer::Token&& origin, AttributeBlock&& attributeBlock, Optional<EntryPointType> entryPointType, UniqueRef<UnnamedType>&& type, String&& name, VariableDeclarations&& parameters, Optional<Semantic>&& semantic, bool isOperator)
</del><ins>+    FunctionDeclaration(Lexer::Token&& origin, AttributeBlock&& attributeBlock, Optional<EntryPointType> entryPointType, UniqueRef<UnnamedType>&& type, String&& name, VariableDeclarations&& parameters, std::unique_ptr<Semantic>&& semantic, bool isOperator)
</ins><span class="cx">         : m_origin(WTFMove(origin))
</span><span class="cx">         , m_attributeBlock(WTFMove(attributeBlock))
</span><span class="cx">         , m_entryPointType(entryPointType)
</span><ins>+        , m_isOperator(WTFMove(isOperator))
</ins><span class="cx">         , m_type(WTFMove(type))
</span><span class="cx">         , m_name(WTFMove(name))
</span><span class="cx">         , m_parameters(WTFMove(parameters))
</span><span class="cx">         , m_semantic(WTFMove(semantic))
</span><del>-        , m_isOperator(WTFMove(isOperator))
</del><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">     bool isCast() const { return m_name == "operator cast"; }
</span><span class="cx">     const VariableDeclarations& parameters() const { return m_parameters; }
</span><span class="cx">     VariableDeclarations& parameters() { return m_parameters; }
</span><del>-    Optional<Semantic>& semantic() { return m_semantic; }
</del><ins>+    Semantic* semantic() { return m_semantic.get(); }
</ins><span class="cx">     bool isOperator() const { return m_isOperator; }
</span><span class="cx">     Lexer::Token origin() { return m_origin; }
</span><span class="cx"> 
</span><span class="lines">@@ -81,11 +81,11 @@
</span><span class="cx">     Lexer::Token m_origin;
</span><span class="cx">     AttributeBlock m_attributeBlock;
</span><span class="cx">     Optional<EntryPointType> m_entryPointType;
</span><ins>+    bool m_isOperator;
</ins><span class="cx">     UniqueRef<UnnamedType> m_type;
</span><span class="cx">     String m_name;
</span><span class="cx">     VariableDeclarations m_parameters;
</span><del>-    Optional<Semantic> m_semantic;
-    bool m_isOperator;
</del><ins>+    std::unique_ptr<Semantic> m_semantic;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace AST
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLReadModifyWriteExpressionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h   2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h      2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -118,8 +118,8 @@
</span><span class="cx">     ReadModifyWriteExpression(Lexer::Token&& origin, UniqueRef<Expression> leftValue)
</span><span class="cx">         : Expression(Lexer::Token(origin))
</span><span class="cx">         , m_leftValue(WTFMove(leftValue))
</span><del>-        , m_oldValue(makeUniqueRef<VariableDeclaration>(Lexer::Token(origin), Qualifiers(), WTF::nullopt, String(), WTF::nullopt, nullptr))
-        , m_newValue(makeUniqueRef<VariableDeclaration>(WTFMove(origin), Qualifiers(), WTF::nullopt, String(), WTF::nullopt, nullptr))
</del><ins>+        , m_oldValue(makeUniqueRef<VariableDeclaration>(Lexer::Token(origin), Qualifiers(), WTF::nullopt, String(), nullptr, nullptr))
+        , m_newValue(makeUniqueRef<VariableDeclaration>(WTFMove(origin), Qualifiers(), WTF::nullopt, String(), nullptr, nullptr))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLStructureElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h    2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h       2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> class StructureElement {
</span><span class="cx"> public:
</span><del>-    StructureElement(Lexer::Token&& origin, Qualifiers&& qualifiers, UniqueRef<UnnamedType>&& type, String&& name, Optional<Semantic> semantic)
</del><ins>+    StructureElement(Lexer::Token&& origin, Qualifiers&& qualifiers, UniqueRef<UnnamedType>&& type, String&& name, std::unique_ptr<Semantic>&& semantic)
</ins><span class="cx">         : m_origin(WTFMove(origin))
</span><span class="cx">         , m_qualifiers(WTFMove(qualifiers))
</span><span class="cx">         , m_type(WTFMove(type))
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     const Lexer::Token& origin() const { return m_origin; }
</span><span class="cx">     UnnamedType& type() { return m_type; }
</span><span class="cx">     const String& name() { return m_name; }
</span><del>-    Optional<Semantic>& semantic() { return m_semantic; }
</del><ins>+    Semantic* semantic() { return m_semantic.get(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     Lexer::Token m_origin;
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">     Qualifiers m_qualifiers;
</span><span class="cx">     UniqueRef<UnnamedType> m_type;
</span><span class="cx">     String m_name;
</span><del>-    Optional<Semantic> m_semantic;
</del><ins>+    std::unique_ptr<Semantic> m_semantic;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> using StructureElements = Vector<StructureElement>;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLASTWHLSLVariableDeclarationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h 2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h    2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> class VariableDeclaration : public Value {
</span><span class="cx">     using Base = Value;
</span><span class="cx"> public:
</span><del>-    VariableDeclaration(Lexer::Token&& origin, Qualifiers&& qualifiers, Optional<UniqueRef<UnnamedType>>&& type, String&& name, Optional<Semantic>&& semantic, std::unique_ptr<Expression>&& initializer)
</del><ins>+    VariableDeclaration(Lexer::Token&& origin, Qualifiers&& qualifiers, Optional<UniqueRef<UnnamedType>>&& type, String&& name, std::unique_ptr<Semantic>&& semantic, std::unique_ptr<Expression>&& initializer)
</ins><span class="cx">         : Base(WTFMove(origin))
</span><span class="cx">         , m_qualifiers(WTFMove(qualifiers))
</span><span class="cx">         , m_type(WTFMove(type))
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     }
</span><span class="cx">     const Optional<UniqueRef<UnnamedType>>& type() const { return m_type; }
</span><span class="cx">     UnnamedType* type() { return m_type ? &*m_type : nullptr; }
</span><del>-    Optional<Semantic>& semantic() { return m_semantic; }
</del><ins>+    Semantic* semantic() { return m_semantic.get(); }
</ins><span class="cx">     Expression* initializer() { return m_initializer.get(); }
</span><span class="cx">     bool isAnonymous() const { return m_name.isNull(); }
</span><span class="cx">     std::unique_ptr<Expression> takeInitializer() { return WTFMove(m_initializer); }
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">     Qualifiers m_qualifiers;
</span><span class="cx">     Optional<UniqueRef<UnnamedType>> m_type;
</span><span class="cx">     String m_name;
</span><del>-    Optional<Semantic> m_semantic;
</del><ins>+    std::unique_ptr<Semantic> m_semantic;
</ins><span class="cx">     std::unique_ptr<Expression> m_initializer;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp       2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLChecker.cpp  2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -122,9 +122,9 @@
</span><span class="cx">     const bool isOperator = true;
</span><span class="cx">     auto returnType = makeUniqueRef<AST::PointerType>(Lexer::Token(origin), firstArgument.addressSpace(), firstArgument.elementType().clone());
</span><span class="cx">     AST::VariableDeclarations parameters;
</span><del>-    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), firstArgument.clone(), String(), WTF::nullopt, nullptr));
-    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(origin), intrinsics.uintType())), String(), WTF::nullopt, nullptr));
-    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(origin), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator&[]", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), firstArgument.clone(), String(), nullptr, nullptr));
+    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(origin), intrinsics.uintType())), String(), nullptr, nullptr));
+    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(origin), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator&[]", String::ConstructFromLiteral), WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static AST::NativeFunctionDeclaration resolveWithOperatorLength(Lexer::Token origin, AST::UnnamedType& firstArgument, const Intrinsics& intrinsics)
</span><span class="lines">@@ -132,8 +132,8 @@
</span><span class="cx">     const bool isOperator = true;
</span><span class="cx">     auto returnType = AST::TypeReference::wrap(Lexer::Token(origin), intrinsics.uintType());
</span><span class="cx">     AST::VariableDeclarations parameters;
</span><del>-    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), firstArgument.clone(), String(), WTF::nullopt, nullptr));
-    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(origin), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator.length", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), firstArgument.clone(), String(), nullptr, nullptr));
+    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(origin), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator.length", String::ConstructFromLiteral), WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static AST::NativeFunctionDeclaration resolveWithReferenceComparator(Lexer::Token origin, ResolvingType& firstArgument, ResolvingType& secondArgument, const Intrinsics& intrinsics)
</span><span class="lines">@@ -153,9 +153,9 @@
</span><span class="cx">         }));
</span><span class="cx">     }));
</span><span class="cx">     AST::VariableDeclarations parameters;
</span><del>-    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), argumentType->clone(), String(), WTF::nullopt, nullptr));
-    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(WTFMove(argumentType)), String(), WTF::nullopt, nullptr));
-    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(origin), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator==", String::ConstructFromLiteral), WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), argumentType->clone(), String(), nullptr, nullptr));
+    parameters.append(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(WTFMove(argumentType)), String(), nullptr, nullptr));
+    return AST::NativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(origin), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), String("operator==", String::ConstructFromLiteral), WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> enum class Acceptability {
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLGatherEntryPointItemscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp 2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp    2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx">         for (auto& structureElement : structureDefinition.structureElements()) {
</span><span class="cx">             if (structureElement.semantic())
</span><del>-                m_currentSemantic = &*structureElement.semantic();
</del><ins>+                m_currentSemantic = structureElement.semantic();
</ins><span class="cx">             m_path.append(structureElement.name());
</span><span class="cx">             checkErrorAndVisit(structureElement);
</span><span class="cx">             m_path.takeLast();
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">     {
</span><span class="cx">         ASSERT(!m_currentSemantic);
</span><span class="cx">         if (variableDeclaration.semantic())
</span><del>-            m_currentSemantic = &*variableDeclaration.semantic();
</del><ins>+            m_currentSemantic = variableDeclaration.semantic();
</ins><span class="cx">         ASSERT(variableDeclaration.type());
</span><span class="cx">         m_path.append(variableDeclaration.name());
</span><span class="cx">         checkErrorAndVisit(*variableDeclaration.type());
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx">         if (inputGatherer.error())
</span><span class="cx">             return WTF::nullopt;
</span><span class="cx">     }
</span><del>-    Gatherer outputGatherer(intrinsics, functionDefinition.semantic() ? &*functionDefinition.semantic() : nullptr);
</del><ins>+    Gatherer outputGatherer(intrinsics, functionDefinition.semantic());
</ins><span class="cx">     if (*functionDefinition.entryPointType() != AST::EntryPointType::Compute)
</span><span class="cx">         outputGatherer.checkErrorAndVisit(functionDefinition.type());
</span><span class="cx">     if (outputGatherer.error())
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp        2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp   2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -688,28 +688,28 @@
</span><span class="cx">     return AST::StageInOutSemantic(WTFMove(*origin), *index);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-auto Parser::parseSemantic() -> Expected<Optional<AST::Semantic>, Error>
</del><ins>+auto Parser::parseSemantic() -> Expected<std::unique_ptr<AST::Semantic>, Error>
</ins><span class="cx"> {
</span><span class="cx">     if (!tryType(Lexer::Token::Type::Colon))
</span><del>-        return { WTF::nullopt };
</del><ins>+        return { nullptr };
</ins><span class="cx"> 
</span><span class="cx">     PEEK(token);
</span><span class="cx">     switch (token->type) {
</span><span class="cx">     case Lexer::Token::Type::Attribute: {
</span><span class="cx">         PARSE(result, StageInOutSemantic);
</span><del>-        return { AST::Semantic(WTFMove(*result)) };
</del><ins>+        return { std::make_unique<AST::Semantic>(WTFMove(*result)) };
</ins><span class="cx">     }
</span><span class="cx">     case Lexer::Token::Type::Specialized:  {
</span><span class="cx">         PARSE(result, SpecializationConstantSemantic);
</span><del>-        return { AST::Semantic(WTFMove(*result)) };
</del><ins>+        return { std::make_unique<AST::Semantic>(WTFMove(*result)) };
</ins><span class="cx">     }
</span><span class="cx">     case Lexer::Token::Type::Register:  {
</span><span class="cx">         PARSE(result, ResourceSemantic);
</span><del>-        return { AST::Semantic(WTFMove(*result)) };
</del><ins>+        return { std::make_unique<AST::Semantic>(WTFMove(*result)) };
</ins><span class="cx">     }
</span><span class="cx">     default:  {
</span><span class="cx">         PARSE(result, BuiltInSemantic);
</span><del>-        return { AST::Semantic(WTFMove(*result)) };
</del><ins>+        return { std::make_unique<AST::Semantic>(WTFMove(*result)) };
</ins><span class="cx">     }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h  2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h     2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx">     Expected<AST::ResourceSemantic, Error> parseResourceSemantic();
</span><span class="cx">     Expected<AST::SpecializationConstantSemantic, Error> parseSpecializationConstantSemantic();
</span><span class="cx">     Expected<AST::StageInOutSemantic, Error> parseStageInOutSemantic();
</span><del>-    Expected<Optional<AST::Semantic>, Error> parseSemantic();
</del><ins>+    Expected<std::unique_ptr<AST::Semantic>, Error> parseSemantic();
</ins><span class="cx">     AST::Qualifiers parseQualifiers();
</span><span class="cx">     Expected<AST::StructureElement, Error> parseStructureElement();
</span><span class="cx">     Expected<AST::StructureDefinition, Error> parseStructureDefinition();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLPreserveVariableLifetimescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp     2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp        2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">         bool isEntryPoint = !!functionDefinition.entryPointType();
</span><span class="cx">         if (isEntryPoint) {
</span><span class="cx">             auto structVariableDeclaration = makeUniqueRef<AST::VariableDeclaration>(functionDefinition.origin(), AST::Qualifiers(),
</span><del>-                m_structType->clone(), String(), WTF::nullopt, nullptr);
</del><ins>+                m_structType->clone(), String(), nullptr, nullptr);
</ins><span class="cx"> 
</span><span class="cx">             auto structVariableReference = makeUniqueRef<AST::VariableReference>(AST::VariableReference::wrap(structVariableDeclaration));
</span><span class="cx">             structVariableReference->setType(m_structType->clone());
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx">             makePointerExpression->setTypeAnnotation(AST::RightValue());
</span><span class="cx"> 
</span><span class="cx">             auto pointerDeclaration = makeUniqueRef<AST::VariableDeclaration>(functionDefinition.origin(), AST::Qualifiers(),
</span><del>-                m_pointerToStructType->clone(), "wrapper"_s, WTF::nullopt, WTFMove(makePointerExpression));
</del><ins>+                m_pointerToStructType->clone(), "wrapper"_s, nullptr, WTFMove(makePointerExpression));
</ins><span class="cx">             m_structVariable = &pointerDeclaration;
</span><span class="cx"> 
</span><span class="cx">             AST::VariableDeclarations pointerVariableDeclarations;
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">             functionDefinition.block().statements().insert(1, WTFMove(pointerDeclarationStatement));
</span><span class="cx">         } else {
</span><span class="cx">             auto pointerDeclaration = makeUniqueRef<AST::VariableDeclaration>(functionDefinition.origin(), AST::Qualifiers(),
</span><del>-                m_pointerToStructType->clone(), "wrapper"_s, WTF::nullopt, nullptr);
</del><ins>+                m_pointerToStructType->clone(), "wrapper"_s, nullptr, nullptr);
</ins><span class="cx">             m_structVariable = &pointerDeclaration;
</span><span class="cx">             functionDefinition.parameters().append(WTFMove(pointerDeclaration));
</span><span class="cx">         }
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx">     for (auto& pair : escapedVariables) {
</span><span class="cx">         auto* variable = pair.key;
</span><span class="cx">         String name = pair.value;
</span><del>-        elements.append(AST::StructureElement { Lexer::Token(variable->origin()), { }, variable->type()->clone(), WTFMove(name), WTF::nullopt });
</del><ins>+        elements.append(AST::StructureElement { Lexer::Token(variable->origin()), { }, variable->type()->clone(), WTFMove(name), nullptr });
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Name of this doesn't matter, since we don't use struct names when
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLPropertyResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp      2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp 2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">     }
</span><span class="cx">     if (threadAnderFunction) {
</span><span class="cx">         auto origin = expression->origin();
</span><del>-        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), baseType->clone(), String(), WTF::nullopt, nullptr);
</del><ins>+        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(origin), AST::Qualifiers(), baseType->clone(), String(), nullptr, nullptr);
</ins><span class="cx"> 
</span><span class="cx">         auto variableReference1 = makeUniqueRef<AST::VariableReference>(AST::VariableReference::wrap(variableDeclaration));
</span><span class="cx">         variableReference1->setType(baseType->clone());
</span><span class="lines">@@ -313,7 +313,7 @@
</span><span class="cx">     AST::Expression& innerLeftExpression = leftExpression;
</span><span class="cx"> 
</span><span class="cx">     // Create "p" variable.
</span><del>-    auto pointerVariable = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(leftExpression->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(makeUniqueRef<AST::PointerType>(Lexer::Token(leftExpression->origin()), *leftExpression->typeAnnotation().leftAddressSpace(), leftExpression->resolvedType().clone())), String(), WTF::nullopt, nullptr);
</del><ins>+    auto pointerVariable = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(leftExpression->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(makeUniqueRef<AST::PointerType>(Lexer::Token(leftExpression->origin()), *leftExpression->typeAnnotation().leftAddressSpace(), leftExpression->resolvedType().clone())), String(), nullptr, nullptr);
</ins><span class="cx"> 
</span><span class="cx">     // Create "q" and "r" variables.
</span><span class="cx">     Vector<UniqueRef<AST::VariableDeclaration>> intermediateVariables;
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx">     intermediateVariables.reserveInitialCapacity(chain.size() - 1);
</span><span class="cx">     for (size_t i = 1; i < chain.size(); ++i) {
</span><span class="cx">         auto& propertyAccessExpression = static_cast<AST::PropertyAccessExpression&>(chain[i]);
</span><del>-        intermediateVariables.uncheckedAppend(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(propertyAccessExpression.origin()), AST::Qualifiers(), propertyAccessExpression.resolvedType().clone(), String(), WTF::nullopt, nullptr));
</del><ins>+        intermediateVariables.uncheckedAppend(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(propertyAccessExpression.origin()), AST::Qualifiers(), propertyAccessExpression.resolvedType().clone(), String(), nullptr, nullptr));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Consider a[foo()][b] = c;
</span><span class="lines">@@ -351,7 +351,7 @@
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="cx">         auto& indexExpression = downcast<AST::IndexExpression>(propertyAccessExpression);
</span><del>-        indexVariables.uncheckedAppend(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(propertyAccessExpression.origin()), AST::Qualifiers(), indexExpression.indexExpression().resolvedType().clone(), String(), WTF::nullopt, nullptr));
</del><ins>+        indexVariables.uncheckedAppend(makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(propertyAccessExpression.origin()), AST::Qualifiers(), indexExpression.indexExpression().resolvedType().clone(), String(), nullptr, nullptr));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Vector<UniqueRef<AST::Expression>> expressions;
</span><span class="lines">@@ -563,7 +563,7 @@
</span><span class="cx">         auto baseType = readModifyWriteExpression.leftValue().resolvedType().clone();
</span><span class="cx">         auto pointerType = makeUniqueRef<AST::PointerType>(Lexer::Token(readModifyWriteExpression.leftValue().origin()), *readModifyWriteExpression.leftValue().typeAnnotation().leftAddressSpace(), baseType->clone());
</span><span class="cx"> 
</span><del>-        auto pointerVariable = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(readModifyWriteExpression.leftValue().origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(pointerType->clone()), String(), WTF::nullopt, nullptr);
</del><ins>+        auto pointerVariable = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(readModifyWriteExpression.leftValue().origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(pointerType->clone()), String(), nullptr, nullptr);
</ins><span class="cx"> 
</span><span class="cx">         Vector<UniqueRef<AST::Expression>> expressions;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeArrayOperatorLengthcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp 2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp    2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -65,10 +65,10 @@
</span><span class="cx">     bool isOperator = true;
</span><span class="cx"> 
</span><span class="cx">     for (auto& arrayType : arrayTypes) {
</span><del>-        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(arrayType.get().origin()), AST::Qualifiers(), arrayType.get().clone(), String(), WTF::nullopt, nullptr);
</del><ins>+        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(arrayType.get().origin()), AST::Qualifiers(), arrayType.get().clone(), String(), nullptr, nullptr);
</ins><span class="cx">         AST::VariableDeclarations parameters;
</span><span class="cx">         parameters.append(WTFMove(variableDeclaration));
</span><del>-        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));
</del><ins>+        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), nullptr, isOperator));
</ins><span class="cx">         if (!program.append(WTFMove(nativeFunctionDeclaration)))
</span><span class="cx">             return false;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp        2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp   2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -157,13 +157,13 @@
</span><span class="cx">     for (auto& unnamedTypeKey : unnamedTypes) {
</span><span class="cx">         auto& unnamedType = unnamedTypeKey.unnamedType();
</span><span class="cx"> 
</span><del>-        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(unnamedType.origin()), AST::Qualifiers(), unnamedType.clone(), String(), WTF::nullopt, nullptr);
</del><ins>+        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(unnamedType.origin()), AST::Qualifiers(), unnamedType.clone(), String(), nullptr, nullptr);
</ins><span class="cx">         AST::VariableDeclarations parameters;
</span><span class="cx">         parameters.append(WTFMove(variableDeclaration));
</span><del>-        AST::NativeFunctionDeclaration copyConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.clone(), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+        AST::NativeFunctionDeclaration copyConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.clone(), "operator cast"_str, WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx">         program.append(WTFMove(copyConstructor));
</span><span class="cx"> 
</span><del>-        AST::NativeFunctionDeclaration defaultConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.clone(), "operator cast"_str, AST::VariableDeclarations(), WTF::nullopt, isOperator));
</del><ins>+        AST::NativeFunctionDeclaration defaultConstructor(AST::FunctionDeclaration(Lexer::Token(unnamedType.origin()), AST::AttributeBlock(), WTF::nullopt, unnamedType.clone(), "operator cast"_str, AST::VariableDeclarations(), nullptr, isOperator));
</ins><span class="cx">         if (!program.append(WTFMove(defaultConstructor)))
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="lines">@@ -174,10 +174,10 @@
</span><span class="cx">         if (is<AST::NativeTypeDeclaration>(static_cast<AST::NamedType&>(namedType)) && downcast<AST::NativeTypeDeclaration>(static_cast<AST::NamedType&>(namedType)).isAtomic())
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(namedType.get().origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(namedType.get().origin()), namedType.get())), String(), WTF::nullopt, nullptr);
</del><ins>+        auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(namedType.get().origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(namedType.get().origin()), namedType.get())), String(), nullptr, nullptr);
</ins><span class="cx">         AST::VariableDeclarations parameters;
</span><span class="cx">         parameters.append(WTFMove(variableDeclaration));
</span><del>-        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));
</del><ins>+        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), nullptr, isOperator));
</ins><span class="cx">         program.append(WTFMove(copyConstructor));
</span><span class="cx"> 
</span><span class="cx">         if (is<AST::NativeTypeDeclaration>(static_cast<AST::NamedType&>(namedType))) {
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx">             if (nativeTypeDeclaration.isOpaqueType())
</span><span class="cx">                 continue;
</span><span class="cx">         }
</span><del>-        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));
</del><ins>+        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(), nullptr, isOperator));
</ins><span class="cx">         if (!program.append(WTFMove(defaultConstructor)))
</span><span class="cx">             return false;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeEnumerationFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp        2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp   2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -41,39 +41,39 @@
</span><span class="cx">     bool isOperator = true;
</span><span class="cx">     for (auto& enumerationDefinition : program.enumerationDefinitions()) {
</span><span class="cx">         {
</span><del>-            auto variableDeclaration1 = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), WTF::nullopt, nullptr);
-            auto variableDeclaration2 = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), WTF::nullopt, nullptr);
</del><ins>+            auto variableDeclaration1 = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), nullptr, nullptr);
+            auto variableDeclaration2 = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), nullptr, nullptr);
</ins><span class="cx">             AST::VariableDeclarations parameters;
</span><span class="cx">             parameters.append(WTFMove(variableDeclaration1));
</span><span class="cx">             parameters.append(WTFMove(variableDeclaration2));
</span><del>-            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));
</del><ins>+            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), nullptr, isOperator));
</ins><span class="cx">             if (!program.append(WTFMove(nativeFunctionDeclaration)))
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         {
</span><del>-            auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), WTF::nullopt, nullptr);
</del><ins>+            auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), nullptr, nullptr);
</ins><span class="cx">             AST::VariableDeclarations parameters;
</span><span class="cx">             parameters.append(WTFMove(variableDeclaration));
</span><del>-            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator.value"_str, WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator.value"_str, WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx">             if (!program.append(WTFMove(nativeFunctionDeclaration)))
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         {
</span><del>-            auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), WTF::nullopt, nullptr);
</del><ins>+            auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), String(), nullptr, nullptr);
</ins><span class="cx">             AST::VariableDeclarations parameters;
</span><span class="cx">             parameters.append(WTFMove(variableDeclaration));
</span><del>-            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, enumerationDefinition->type().clone(), "operator cast"_str, WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx">             if (!program.append(WTFMove(nativeFunctionDeclaration)))
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         {
</span><del>-            auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), enumerationDefinition->type().clone(), String(), WTF::nullopt, nullptr);
</del><ins>+            auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(enumerationDefinition->origin()), AST::Qualifiers(), enumerationDefinition->type().clone(), String(), nullptr, nullptr);
</ins><span class="cx">             AST::VariableDeclarations parameters;
</span><span class="cx">             parameters.append(WTFMove(variableDeclaration));
</span><del>-            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), "operator cast"_str, WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+            AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(enumerationDefinition->origin()), AST::AttributeBlock(), WTF::nullopt, UniqueRef<AST::UnnamedType>(AST::TypeReference::wrap(Lexer::Token(enumerationDefinition->origin()), enumerationDefinition)), "operator cast"_str, WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx">             if (!program.append(WTFMove(nativeFunctionDeclaration)))
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebgpuWHLSLWHLSLSynthesizeStructureAccessorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp (247109 => 247110)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp  2019-07-03 21:59:07 UTC (rev 247109)
+++ trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp     2019-07-03 22:11:36 UTC (rev 247110)
</span><span class="lines">@@ -47,11 +47,11 @@
</span><span class="cx">             // The ander: operator&.field
</span><span class="cx">             auto createAnder = [&](AST::AddressSpace addressSpace) -> AST::NativeFunctionDeclaration {
</span><span class="cx">                 auto argumentType = makeUniqueRef<AST::PointerType>(Lexer::Token(structureElement.origin()), addressSpace, AST::TypeReference::wrap(Lexer::Token(structureElement.origin()), structureDefinition));
</span><del>-                auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(structureElement.origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(WTFMove(argumentType)), String(), WTF::nullopt, nullptr);
</del><ins>+                auto variableDeclaration = makeUniqueRef<AST::VariableDeclaration>(Lexer::Token(structureElement.origin()), AST::Qualifiers(), UniqueRef<AST::UnnamedType>(WTFMove(argumentType)), String(), nullptr, nullptr);
</ins><span class="cx">                 AST::VariableDeclarations parameters;
</span><span class="cx">                 parameters.append(WTFMove(variableDeclaration));
</span><span class="cx">                 auto returnType = makeUniqueRef<AST::PointerType>(Lexer::Token(structureElement.origin()), addressSpace, structureElement.type().clone());
</span><del>-                AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), makeString("operator&.", structureElement.name()), WTFMove(parameters), WTF::nullopt, isOperator));
</del><ins>+                AST::NativeFunctionDeclaration nativeFunctionDeclaration(AST::FunctionDeclaration(Lexer::Token(structureElement.origin()), AST::AttributeBlock(), WTF::nullopt, WTFMove(returnType), makeString("operator&.", structureElement.name()), WTFMove(parameters), nullptr, isOperator));
</ins><span class="cx">                 return nativeFunctionDeclaration;
</span><span class="cx">             };
</span><span class="cx">             if (!program.append(createAnder(AST::AddressSpace::Constant))
</span></span></pre>
</div>
</div>

</body>
</html>