-
Notifications
You must be signed in to change notification settings - Fork 242
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
Feature/initialize list side branch #6058
Open
kaizhangNV
wants to merge
34
commits into
shader-slang:master
Choose a base branch
from
kaizhangNV:feature/initialize-list-side-branch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
e0378c6
SP004: implement initialize list translation to ctor
kaizhangNV 0f295da
simplify the logic for creating invoke for synthesized ctor
kaizhangNV 9c40cba
Implement a fallback mechanism to the legacy init list
kaizhangNV ee7bdf8
Address some comment feedback
kaizhangNV 907a50f
Implement filling the ctor body
kaizhangNV 56047da
Apply the new rule for inheritance
kaizhangNV 8f89551
Keep implementing filling the ctor body
kaizhangNV 7684104
Fix test errors
kaizhangNV 4035b7f
Keep fixing test errors
kaizhangNV acc3830
Fix more test errors
kaizhangNV 6c013a3
Fix the diagnostic issue and no_diff issue
kaizhangNV e4dbe41
Fix test failure for hlsl-syntax.slang
kaizhangNV 87523c8
fix smoke-gfx
kaizhangNV 799bc43
Fix bug
kaizhangNV b3405b5
Fix test errors
kaizhangNV 73e7950
fix bug: default value of parameter
kaizhangNV 4a91a67
Fix reflection test
kaizhangNV 6146fea
fix gfx-smoke test
kaizhangNV bce3bf8
Bypass the issue #4874 for now
kaizhangNV c0bc16e
Remove the default constructor when we have a valid member init const…
kaizhangNV 950b071
DNI: Test new Falcor test
kaizhangNV 593270a
Fix issue in wrongly using base contructor
kaizhangNV 46351bd
DNI: Test new Falcor-Compile-perf test
kaizhangNV fdb52c8
remove WAR for global variable
kaizhangNV 989b104
Fix tests due to removing the default constructor
kaizhangNV cffa13c
Disable -zero-initialize option
kaizhangNV 4ee436e
fix gfx-smoke test due to remove default constructor
kaizhangNV c8f667f
include enum type to the rule of C-Style struct
kaizhangNV 65a6474
fix ABI breaking
kaizhangNV 2f41cd4
remove hlsl-syntax.slang.expected files
kaizhangNV 99acef4
remove unnecessary lines
kaizhangNV adec731
Add cuda-host decoration for the synthesized constructor
kaizhangNV db3063a
Address low hanging fruit comments and format
kaizhangNV de53b13
Attempt to fix the overload lookup issue
kaizhangNV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 wonder what this is used for, and I am guessing it is used to prevent synthesis of a ctor if there is already one provided via an extension.
I think the decision on whether or not to synthesize a ctor should be solely based on the struct type itself, and not any extensions.
We also need to make sure in the presence of an extension, the ctor provided in the extension should take precedence over the implicitly synthesized method during overload resolution.
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.
Well, this seems like a corner case we haven't discussed before.
I thought extension will be part of the struct, so it can also determine whether we should define the ctor.
The thing is that if the syntheized ctor is exactly the same as the explicit ctor in extension, won't that be a compile 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.
Yes, this what I was saying that during overload resolution, if we see a user defined ctor that is as good as the synthesized one, it should always be preferred over implicitly generated ones.
The one reason that ctor synthesis shouldn't depend on extensions is if a module defines public X and an internal extension on X that adds a ctor, should we synthesize ctor for X or not? When this decision is affected by extensions, we will say we don't. But then from the user of the module's perspective this is weird because they don't get to see the extension and yet X for some reason doesn't have the expected ctor.
If we say the decision is not dependent on extensions, then we will always synthesize the ctor. But inside the module that sees both the extension and X itself, the user defined ctor will be preferred over the synthesized one if it is applicable, so we will have no issues. From the outside of the module, they still can use the synthesized ctor without surprises.