[clang] [HLSL][Docs] Add documentation for HLSL functions (PR #75397)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 14 22:12:09 PST 2023


rjmccall wrote:

> @rjmccall, I'm curious if you have any thoughts on the proposed implementation approach here?
> 
> The TL;DR for the gnarly bit is to have AST nodes representing parameters that need temporary values, and for "output" parameters where there may be cast sequences involved the AST node will capture the cast sequences for both parameter initialization and writing back to the argument lvalue. Then we can slightly tweak the CGCall write back support to support having a cast sequence in the AST.

Yeah, I think having the argument being some kind of special expression that stores the cast sequences back and forth makes a lot of sense.

I've frequently felt that our `Expr`-centric representation for cast sequences is unnecessarily awkward to work with; we'd probably benefit from some sort of explicit `Cast` representation that would just get stored in a `CastExpr`.  I can't in good conscience ask you to implement that and then refactor all our conversion code in CodeGen around it, though.  Given our current representations, you probably just need to do something with `OpaqueValueExpr`.

https://github.com/llvm/llvm-project/pull/75397


More information about the cfe-commits mailing list