Skip to content

Parameter InputModifier like in/out/inout #59849

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

Closed
Tracked by #67692
python3kgae opened this issue Jan 6, 2023 · 2 comments · Fixed by #72139
Closed
Tracked by #67692

Parameter InputModifier like in/out/inout #59849

python3kgae opened this issue Jan 6, 2023 · 2 comments · Fixed by #72139
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support

Comments

@python3kgae
Copy link
Contributor

Support InputModifier like in/out/inout
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-function-parameters

@python3kgae python3kgae added the HLSL HLSL Language Support label Jan 6, 2023
@llvm-beanz llvm-beanz self-assigned this Oct 24, 2023
@llvm-beanz
Copy link
Collaborator

This is related to 67692.

@llvm-beanz llvm-beanz moved this to Needs Review in HLSL Support Nov 13, 2023
@github-project-automation github-project-automation bot moved this from Needs Review to Done in HLSL Support Nov 28, 2023
llvm-beanz added a commit that referenced this issue Nov 28, 2023
This change implements parsing for HLSL's parameter modifier keywords
`in`, `out` and `inout`. Because HLSL doesn't support references or
pointers, these keywords are used to allow parameters to be passed in
and out of functions.

This change only implements the parsing and AST support. In the HLSL
ASTs we represent `out` and `inout` parameters as references, and we
implement the semantics of by-value passing during IR generation.

In HLSL parameters marked `out` and `inout` are ambiguous in function
declarations, and `in`, `out` and `inout` may be ambiguous at call
sites.

This means a function may be defined as `fn(in T)` and `fn(inout T)` or
`fn(out T)`, but not `fn(inout T)` and `fn(out T)`. If a funciton `fn`
is declared with `in` and `inout` or `out` arguments, the call will be
ambiguous the same as a C++ call would be ambiguous given declarations
`fn(T)` and `fn(T&)`.

Fixes #59849
@EugeneZelenko EugeneZelenko added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Nov 28, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 28, 2023

@llvm/issue-subscribers-clang-frontend

Author: Xiang Li (python3kgae)

Support InputModifier like in/out/inout https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-function-parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants