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

fix GetIdxsForTyFromOffset with local type #1294

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

rjodinchr
Copy link
Collaborator

Both resource and local type start with array of zero element. Also fix the startIdx for those as the "empty" array will be removed by the rework of the type getting rid of it.

Both resource and local type start with array of zero element.
Also fix the startIdx for those as the "empty" array will be removed
by the rework of the type getting rid of it.
Copy link
Collaborator

@alan-baker alan-baker left a comment

Choose a reason for hiding this comment

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

Nit about explanation.

Comment on lines 1276 to 1279
Idxs.push_back(ConstantInt::get(Builder.getInt32Ty(), 0));
startIdx = 1;
if (!(SrcTy->isArrayTy() && GetNumEle(SrcTy) == 0)) {
startIdx = 1;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This probably deserves a comment and perhaps helper method IsUnsizedType(). Alternatively it might be clearer to break this in a global variable and alloca case and then a resource (global or local) case and mention that interfaces use unsized arrays again.

@alan-baker alan-baker merged commit 806c96a into google:main Jan 31, 2024
10 of 12 checks passed
@rjodinchr rjodinchr deleted the pr/store-local branch January 31, 2024 14:46
@rjodinchr
Copy link
Collaborator Author

Ref #1292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants