[llvm-branch-commits] [clang] [HLSL] Add codegen for accessing resource members of a struct (PR #187127)

Justin Bogner via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 30 10:46:39 PDT 2026


================
@@ -5472,10 +5472,20 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) {
     EmitIgnoredExpr(E->getBase());
     return EmitDeclRefLValue(DRE);
   }
-  if (getLangOpts().HLSL &&
-      E->getType().getAddressSpace() == LangAS::hlsl_constant) {
+
+  if (getLangOpts().HLSL) {
+    QualType QT = E->getType();
     // We have an HLSL buffer - emit using HLSL's layout rules.
----------------
bogner wrote:

This (and the next) comment probably aren't necessary at this point - they mostly just repeat what the next line or two do. If a comment is helpful here it should say "why" rather than just "what".

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


More information about the llvm-branch-commits mailing list