[clang] [HLSL][Matrix] introduce MatrixElementExpr as accessor and swizzle operator (PR #171225)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 17 23:40:33 PST 2025


================
@@ -4472,6 +4543,59 @@ void ExtVectorElementExpr::getEncodedElementAccess(
   }
 }
 
+void MatrixElementExpr::getEncodedElementAccess(
----------------
hekota wrote:

The functions `containsDuplicateElements` and `getEncodedElementAccess` seem to have a lot of common code. Consider moving the common part into a function with a lambda arg which would handle the calculated index. The lambda for `getEncodedElementAccess` would add the index to the list, and the lambda for `containsDuplicateElements` would check if it is a duplicate.

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


More information about the cfe-commits mailing list