-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WGSL] Record type errors while type checking #9603
[WGSL] Record type errors while type checking #9603
Conversation
EWS run on previous version of this PR (hash 1535244) |
out.print(m_span.m_line, ":", m_span.m_lineOffset, " length:", m_span.m_length, m_message); | ||
out.print(m_span.m_line, ":", m_span.m_lineOffset, ":", m_message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came to this function to fix the mix colon, but then I didn't think the length was helpful, and it's a pretty standard error format to report only line and column. Happy to add it back though if you think it's helpful.
Source/WebGPU/WGSL/TypeCheck.cpp
Outdated
{ | ||
// FIXME: Implement all the rules and report a type error otherwise | ||
if (shouldDumpInferredTypes) | ||
dataLogLn("[unify] '", *lhs, "' <", RawPointer(lhs), "> and '", *rhs, "' <", RawPointer(rhs), ">"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WTFLogAlways() :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replied in another PR asking whether you felt strongly about using WTFLogAlways
over dataLog
, as I don't see why one is strictly better than other, but I don't think you replied. I searched for when to use one over the other, and as far as I could tell it seemed to be a preference thing. dataLog
does seem more flexible than WTFLogAlways
, so I'd personally prefer to stick to that if you are not strictly opposed.
Source/WebGPU/WGSL/TypeCheck.cpp
Outdated
|
||
if (shouldDumpInferredTypes) { | ||
for (auto& error : m_errors) | ||
dataLogLn(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WTFLogAlways() :(
Source/WebGPU/WGSL/TypeCheck.cpp
Outdated
@@ -79,12 +85,14 @@ class TypeChecker : public AST::Visitor, public ContextProvider<Type*> { | |||
Type* m_u32; | |||
Type* m_f32; | |||
FixedVector<TypeConstructor> m_typeConstrutors; | |||
WTF::Vector<Error> m_errors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of think Error
and m_errors
are bad names, because warnings go here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error
and Warning
are aliases to the same underlying class (CompilationMessage
). I think we should probably keep them separate, no? It would be helpful to know whether there were any errors or not, although that would mess up the order of reporting... either way, we're only reporting errors for now, I can rename it once we get to warnings.
1535244
to
4bbac10
Compare
EWS run on previous version of this PR (hash 4bbac10) |
4bbac10
to
23bb8a7
Compare
EWS run on current version of this PR (hash 23bb8a7) |
Committed 259892@main (cd24b94): https://commits.webkit.org/259892@main Reviewed commits have been landed. Closing PR #9603 and removing active labels. |
23bb8a7
to
cd24b94
Compare
cd24b94
23bb8a7
π§ͺ api-gtk