Skip to content

Conversation

@llvm-beanz
Copy link
Collaborator

This should resolve #584 by adopting C++ for loop scoping rules for
HLSL 2021.

This should resolve microsoft#584 by adopting C++ for loop scoping rules for
HLSL 2021.
@llvm-beanz llvm-beanz added the hlsl2021 Pertaining to HLSL2021 features label Nov 16, 2021
@llvm-beanz llvm-beanz requested review from pow2clk and tex3d November 16, 2021 00:42
@AppVeyorBot
Copy link

Copy link
Collaborator

@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.

Nice to squeeze this in!

I have an NFC alternative suggestion


// HLSL Change Starts - leak declarations in for control parts into outer scope
if (getLangOpts().HLSL) {
if (getLangOpts().HLSLVersion < 2020) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

It makes little difference to the end result, but referencing non-existent version 2020 makes me just a bit uncomfortable. The way these kind of checks are done elsewhere is of the form HLSLVersion < 2021.

The only reason I can think of is if someone wants to search for all the places that HLSLVersion 2021 changes the behavior and would miss this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My brain is still slightly stuck in March 2020... I think today's date is 3/626/2020...

@AppVeyorBot
Copy link

@llvm-beanz llvm-beanz merged commit 9f0b253 into microsoft:master Nov 16, 2021
@llvm-beanz llvm-beanz deleted the cbieneman/for-loop-scoping branch December 22, 2021 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hlsl2021 Pertaining to HLSL2021 features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spurious warnings about duplicated loop indices

3 participants