[PATCH] D116464: [SPIRV 5/6] Add LegalizerInfo, InstructionSelector and utilities

Ilia Diachkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 16:32:06 PDT 2022


iliya-diyachkov added inline comments.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp:159
+      GVar = new GlobalVariable(
+          *const_cast<llvm::Module *>(Module), const_cast<Type *>(Ty), false,
+          GlobalValue::ExternalLinkage, nullptr, Twine(Name));
----------------
arsenm wrote:
> no const_casts?
`Module` is fixed, but I'm not sure how to cast `const Type *Ty` to `Type *` without const_cast.

I see that other targets uses this approach in the similar cases (ARM, Hexagon).


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

https://reviews.llvm.org/D116464



More information about the llvm-commits mailing list