[PATCH] D130017: [HLSL] Add RWBuffer default constructor

Justin Bogner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 27 11:57:20 PDT 2022


bogner accepted this revision.
bogner added a comment.
This revision is now accepted and ready to land.

Is it worth adding a test that calls this constructor / checks that we end up with a call to the builtin?



================
Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:155
+        AST, Fn,
+        {emitResourceClassExpr(AST, RC)},
+        AST.VoidPtrTy, VK_PRValue, SourceLocation(), FPOptionsOverride());
----------------
In this case it just creates a literal so it's technically fine, but in general seeing these "emit" functions in argument lists can lead to things like the generated IR being in a different order depending on the compiler. Better to store the Expr in a variable as a matter of style.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130017/new/

https://reviews.llvm.org/D130017



More information about the cfe-commits mailing list