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

Begin specifying object model #393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

llvm-beanz
Copy link
Collaborator

This change begins to define the object model for HLSL and clearly denotes aggregate and non-aggregate types. It provides base definitions for sub-object ordering and scalar elementwise ordering. It also defines non-decomposable objects and stubs out sections for constructon and access control.

HLSL does not currently support user-defined constructors or access control specifiers, however both are used implicitly and denote non-decomposible objects.

Fixes #372

This change begins to define the object model for HLSL and clearly denotes aggregate and non-aggregate types. It provides base definitions for sub-object ordering and scalar elementwise ordering. It also defines non-decomposable objects and stubs out sections for constructon and access control.

HLSL does not currently support user-defined constructors or access control specifiers, however both are used implicitly and denote non-decomposible objects.

Fixes microsoft#372
@llvm-beanz llvm-beanz requested a review from V-FEXrt February 17, 2025 22:30
@github-actions github-actions bot added the language-spec Issue with completed spec label Feb 17, 2025
@llvm-beanz llvm-beanz requested review from spall and tex3d February 17, 2025 22:30
assignment-expression in an initializer-list and performing a depth-first
traversal accessing each subobject of the assignment-expression.
which may be a scalar or aggregate type. A \textit{element-wise initializer
sequence} is constructed by concatenating the scalar element ordering
Copy link
Collaborator

@farzonl farzonl Feb 18, 2025

Choose a reason for hiding this comment

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

I think I see how this would work for matricies and vectors and 1 dim arrays. I'm not as clear on how it works for multi dim Arrays and Classes of classes/structs. I think the depth-first traversal algorithm covered finding these nested initalizers. Can you explain what concatenating is doing here to cover cases like arrays of classes and classes of classes?

Second should we link scalar element ordering to line 363 in specs/language/introduction.tex?

When I think scalar i'm thinking the non container types like primitive types like float/int/bool/etc which makes me think we are excluding classes, but thats at odds with the types Aggregate Initialization covers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Are you suggesting something other than the (\ref{Intro.Object.SubOrdering}) that is right after the use of the term?

\(E_n\)'s type.
target object's scalar element ordering there is a corresponding initializer
\(I_n\) in the element-wise initializer sequence which can be implicitly
converted to the element's type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe reference E_n here, 'which can be implicitly converted to 'E_n's type'

called a \textit{sub-object}. An object that is not contained by any other object
is called a \textit{complete object}.

\p An object or sub-object that is a non-intangible type will have an associated
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think I recall there being some disagreement about this term before, non-intangible type. I think its easy to skim over this word and hear 'non tangible' type. Could we be more clear and say 'Not an Intangible type'? Or do we need a one word phrase?


\p An object or sub-object that is a non-intangible type will have an associated
memory location. An object of intangible type will only have a memory location
if it contains a sub-object of non-intangible type (\ref{Basic.types}).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Tangible type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language-spec Issue with completed spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define object, subobject, and non-divisible sub-subobject
3 participants