Skip to content
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

Start working on HLSL initialization lists #329

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

llvm-beanz
Copy link
Collaborator

This one is a bit gnarly because it involves a lot of depth-first traversing of declarations, types, and initialization expresssions.

Questions and suggestions on how to clarify are greatly appreciated!

This one is a bit gnarly because it involves a lot of depth-first traversing of declarations, types, and initialization expresssions.

Questions and suggestions on how to clarify are greatly appreciated!
Copy link
Member

@pow2clk pow2clk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the depth-first traversal well enough. I think an example would be helpful to some, but perhaps that doesn't fit in this context?

specs/language/declarations.tex Outdated Show resolved Hide resolved
element's type.

\p An initializer-list is invalid if the flattened initializer sequence contains
less elements than the target object's flattened ordering, or if any initializer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fewer elements

in the flattened initializer sequence which can be implicitly converted to the
element's type.

\p An initializer-list is invalid if the flattened initializer sequence contains
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An initializer-list is valid if too many elements are provided?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated language in the latest version


\p Each \textit{initializer-list} is comprised of zero or more
\textit{initializer-clause} expressions, which in turn may be another
initializer-list or an \textit{assignment-expression}. Each
Copy link

@spall spall Oct 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen the whole grammar so maybe assignment-expression isn't used elsewhere, but it seems natural it would mean A=B (where = is used visually). I wonder if there is a better term for this. Like 'initializer-value'.
Also, maybe this is visualized with '=', then disregard my comment. But maybe it would be good to have a definition of 'assignment-expression' included in the provided grammar to clarify.
Edit: I now know C++ better

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The most recent update here tried to clarify the language and not use the grammar tokens since the C++ grammar is a bit bonkers to follow.

depth-first traversal of the subobjects of an object following the defined
subobject ordering.

\p Each \textit{initializer-list} is comprised of zero or more
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned this offline, I think 'initializer-list' is the wrong term here since it isn't defined in the grammar to be allowed to be empty.

@llvm-beanz llvm-beanz added the Design Meeting Agenda item for the design meeting label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Meeting Agenda item for the design meeting
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants