[clang] [HLSL] Implement output parameter (PR #101083)

John McCall via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 11:27:48 PDT 2024


================
@@ -8511,7 +8514,7 @@ static void HandleHLSLParamModifierAttr(QualType &CurType,
     return;
   if (Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_inout ||
       Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_out)
-    CurType = S.getASTContext().getLValueReferenceType(CurType);
+    CurType = S.HLSL().getInoutParameterType(CurType);
----------------
rjmccall wrote:

You can't reseat a reference, so I don't know what it would mean to pass one `inout`.  It should probably be invalid.

At any rate, if HLSL doesn't allow references, that's fine; please document that expectation with a comment, though (and maybe an assertion that we never see a reference here?).

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


More information about the cfe-commits mailing list