WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
193430
[WHLSL] Add the literal type checker
https://bugs.webkit.org/show_bug.cgi?id=193430
Summary
[WHLSL] Add the literal type checker
Myles C. Maxfield
Reported
2019-01-14 20:45:55 PST
[WHLSL] Add the literal type checker
Attachments
Patch
(12.67 KB, patch)
2019-01-14 20:47 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(13.21 KB, patch)
2019-01-15 16:03 PST
,
Myles C. Maxfield
no flags
Details
Formatted Diff
Diff
Patch
(19.83 KB, patch)
2019-01-15 19:10 PST
,
Myles C. Maxfield
dino
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Myles C. Maxfield
Comment 1
2019-01-14 20:47:29 PST
Created
attachment 359126
[details]
Patch
Myles C. Maxfield
Comment 2
2019-01-14 20:53:14 PST
Comment on
attachment 359126
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=359126&action=review
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:104 > + virtual void visit(AST::FloatLiteralType& floatLiteralType) > + { > + auto* nativeTypeDeclaration = getNativeTypeDeclaration(floatLiteralType); > + if (!nativeTypeDeclaration) { > + setError(); > + return; > + } > + if (!nativeTypeDeclaration->canRepresentInteger()(floatLiteralType.value())) { > + setError(); > + return; > + } > + } > + > + virtual void visit(AST::IntegerLiteralType& integerLiteralType) > + { > + auto* nativeTypeDeclaration = getNativeTypeDeclaration(integerLiteralType); > + if (!nativeTypeDeclaration) { > + setError(); > + return; > + } > + if (!nativeTypeDeclaration->canRepresentInteger()(integerLiteralType.value())) { > + setError(); > + return; > + } > + } > + > + virtual void visit(AST::UnsignedIntegerLiteralType& unsignedIntegerLiteralType) > + { > + auto* nativeTypeDeclaration = getNativeTypeDeclaration(unsignedIntegerLiteralType); > + if (!nativeTypeDeclaration) { > + setError(); > + return; > + } > + if (!nativeTypeDeclaration->canRepresentInteger()(unsignedIntegerLiteralType.value())) { > + setError(); > + return; > + } > + } > + > + virtual void visit(AST::NullLiteralType& nullLiteralType) > + { > + if (!nullLiteralType.resolvedType()) > + setError(); > + }
These can be private.
Myles C. Maxfield
Comment 3
2019-01-14 20:55:08 PST
Comment on
attachment 359126
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=359126&action=review
>> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:104 >> + } > > These can be private.
Also be marked as override instead of virtual.
Myles C. Maxfield
Comment 4
2019-01-15 16:03:35 PST
Created
attachment 359216
[details]
Patch
Myles C. Maxfield
Comment 5
2019-01-15 19:10:08 PST
Created
attachment 359245
[details]
Patch
Saam Barati
Comment 6
2019-01-16 08:36:51 PST
Comment on
attachment 359245
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=359245&action=review
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:67 > + ASSERT(nativeTypeDeclaration->canRepresentInteger()(floatLiteralType.value()));
This doesn’t look correct to me but I haven’t looked in detail. Shouldn’t this be something like canRepresentFloat?
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:100 > +}
// namespace ..
Dean Jackson
Comment 7
2019-01-16 12:30:10 PST
Comment on
attachment 359245
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=359245&action=review
> Source/WebCore/Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:60 > + LiteralTypeChecker() = default; > + > + virtual ~LiteralTypeChecker() = default;
Not needed.
Myles C. Maxfield
Comment 8
2019-01-16 16:31:27 PST
Committed
r240095
: <
https://trac.webkit.org/changeset/240095
>
Radar WebKit Bug Importer
Comment 9
2019-01-16 16:32:38 PST
<
rdar://problem/47334356
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug