This change makes this a reference instead of a pointer in
HLSL. HLSL does not have the -> operator, and accesses through this
are with the . syntax.
Tests were added and altered to make sure
the AST accurately reflects the types.
Differential D135721
[HLSL] Added HLSL this as a reference gracejennings on Oct 11 2022, 3:29 PM. Authored by
Details This change makes this a reference instead of a pointer in Tests were added and altered to make sure
Diff Detail
Event Timeline
Comment Actions Looping in @aaron.ballman here too because this is a bit of a fun one... I know Aaron loves when we show him the best of HLSL 😄
Comment Actions Thank you for your patience while I sat and thought about this for a while. I'm not against the idea, but I've definitely got some design concerns with it which I've pointed out in the review. I think this also needs considerably more testing of the codegen and semantic behaviors around improper use of this. It's also worth investigating what else needs modifications to support this properly -- I would imagine the static analyzer cares about CXXThisExpr semantics, and I'm betting thread safety analysis does as well. If you haven't already, you should search for uses of CXXThisExpr in the code base to spot other areas that need test coverage to prove they still work properly in HLSL.
Comment Actions Generally looking good to me aside from a test change that I don't quite understand yet.
Comment Actions LGTM, thank you!
|
Should this be a reference type?