Skip to content

Commit

Permalink
[CIR] Correct initialization of VoidPtrPtrTy
Browse files Browse the repository at this point in the history
  • Loading branch information
AdUhTkJm committed Feb 11, 2025
1 parent 637f2f3 commit bdd898c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 4 additions & 8 deletions clang/lib/CIR/CodeGen/CIRGenTypeCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bdd898c

Please sign in to comment.