[llvm] [SPIRV][NFC] Refactor pointer creation in GlobalRegistery (PR #134429)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 05:48:11 PDT 2025


================
@@ -1693,6 +1728,43 @@ SPIRVType *SPIRVGlobalRegistry::getOrCreateSPIRVArrayType(
 }
 
 SPIRVType *SPIRVGlobalRegistry::getOrCreateSPIRVPointerType(
+    Type *BaseType, MachineInstr &I, SPIRV::StorageClass::StorageClass SC) {
+  MachineIRBuilder MIRBuilder(I);
+  return getOrCreateSPIRVPointerType(BaseType, MIRBuilder, SC);
+}
+
+SPIRVType *SPIRVGlobalRegistry::getOrCreateSPIRVPointerType(
+    Type *BaseType, MachineIRBuilder &MIRBuilder,
----------------
Keenuts wrote:

Those `Type*` can be marked `const`, which will allow you to remove the `const_cast`

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


More information about the llvm-commits mailing list