[clang] [HLSL] Allow arrays to be returned by value in HLSL (PR #127896)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 24 08:00:45 PST 2025


================
@@ -2803,6 +2803,10 @@ class ASTContext : public RefCountedBase<ASTContext> {
     return getUnqualifiedArrayType(T, Quals);
   }
 
+  // Determine whether an array is a valid return type
+  // Array is a valid return type for HLSL
+  bool isReturnableArrayType() const { return getLangOpts().HLSL; }
----------------
llvm-beanz wrote:

This should probably also take the type and check that the type is an array type, otherwise it's more of a language options check for whether or not array types are allowed to be returned.

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


More information about the cfe-commits mailing list