diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index 76221be12319..c1d2ca71fb16 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -128,6 +128,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, // Initialize CIR pointer types cache. VoidPtrTy = cir::PointerType::get(&getMLIRContext(), VoidTy); + VoidPtrPtrTy = cir::PointerType::get(&getMLIRContext(), VoidPtrTy); FP16Ty = cir::FP16Type::get(&getMLIRContext()); BFloat16Ty = cir::BF16Type::get(&getMLIRContext()); @@ -159,6 +160,7 @@ CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext, UInt8PtrTy = builder.getPointerTo(UInt8Ty); UInt8PtrPtrTy = builder.getPointerTo(UInt8PtrTy); AllocaInt8PtrTy = UInt8PtrTy; + AllocaVoidPtrTy = VoidPtrTy; // TODO: GlobalsInt8PtrTy // TODO: ConstGlobalsPtrTy CIRAllocaAddressSpace = getTargetCIRGenInfo().getCIRAllocaAddressSpace(); diff --git a/clang/lib/CIR/CodeGen/CIRGenTypeCache.h b/clang/lib/CIR/CodeGen/CIRGenTypeCache.h index 4e29ad5dca46..551bc74861b6 100644 --- a/clang/lib/CIR/CodeGen/CIRGenTypeCache.h +++ b/clang/lib/CIR/CodeGen/CIRGenTypeCache.h @@ -62,16 +62,12 @@ struct CIRGenTypeCache { cir::PointerType UInt8PtrTy; /// void** in address space 0 - union { - cir::PointerType VoidPtrPtrTy; - cir::PointerType UInt8PtrPtrTy; - }; + cir::PointerType VoidPtrPtrTy; + cir::PointerType UInt8PtrPtrTy; /// void* in alloca address space - union { - cir::PointerType AllocaVoidPtrTy; - cir::PointerType AllocaInt8PtrTy; - }; + cir::PointerType AllocaVoidPtrTy; + cir::PointerType AllocaInt8PtrTy; /// void* in default globals address space // union {