[PATCH] D125334: [DirectX] Embed DXIL in LLVM Module

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 13:10:46 PDT 2022


kuhar added inline comments.


================
Comment at: llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp:69-70
+
+    ArrayRef<uint8_t> ModuleData =
+        ArrayRef<uint8_t>((const uint8_t *)Data.data(), Data.size());
+
----------------
kuhar wrote:
> 1. Are we sure that `WriteDXILToFile` flushes the stream before returning?
> 2. We don't need the assignment, you can do `ArrayRef<uint8_t> X(A, B)` to run the constructor that takes two pointers/.
> 3. Use `reinterpret_cast` instead of C-style casts.
There's also `arrayRefFromStringRef` in `StringExtras.h`, but I'm not 100% sure if non-const `ArrayRef` is convertible to const-typed one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125334



More information about the llvm-commits mailing list