Skip to content

Commit c536935

Browse files
committed
[CodeGen] Replace PointerType::getUnqual(Type) with opaque
pointer version (NFC) Follow-up to #123569
1 parent d5cec38 commit c536935

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

clang/lib/CodeGen/ABIInfoImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ Address CodeGen::EmitVAArgInstr(CodeGenFunction &CGF, Address VAListAddr,
430430
CharUnits TyAlignForABI = TyInfo.Align;
431431

432432
llvm::Type *ElementTy = CGF.ConvertTypeForMem(Ty);
433-
llvm::Type *BaseTy = llvm::PointerType::getUnqual(ElementTy);
433+
llvm::Type *BaseTy = llvm::PointerType::getUnqual(CGF.getLLVMContext());
434434
llvm::Value *Addr =
435435
CGF.Builder.CreateVAArg(VAListAddr.emitRawPointer(CGF), BaseTy);
436436
return Address(Addr, ElementTy, TyAlignForABI);

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,13 +1476,7 @@ llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() {
14761476
}
14771477

14781478
llvm::Type *CGOpenMPRuntime::getKmpc_MicroPointerTy() {
1479-
if (!Kmpc_MicroTy) {
1480-
// Build void (*kmpc_micro)(kmp_int32 *global_tid, kmp_int32 *bound_tid,...)
1481-
llvm::Type *MicroParams[] = {llvm::PointerType::getUnqual(CGM.Int32Ty),
1482-
llvm::PointerType::getUnqual(CGM.Int32Ty)};
1483-
Kmpc_MicroTy = llvm::FunctionType::get(CGM.VoidTy, MicroParams, true);
1484-
}
1485-
return llvm::PointerType::getUnqual(Kmpc_MicroTy);
1479+
return llvm::PointerType::getUnqual(CGM.getLLVMContext());
14861480
}
14871481

14881482
static llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseKind

clang/lib/CodeGen/CGOpenMPRuntime.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,6 @@ class CGOpenMPRuntime {
386386
/// Map for SourceLocation and OpenMP runtime library debug locations.
387387
typedef llvm::DenseMap<SourceLocation, llvm::Value *> OpenMPDebugLocMapTy;
388388
OpenMPDebugLocMapTy OpenMPDebugLocMap;
389-
/// The type for a microtask which gets passed to __kmpc_fork_call().
390-
/// Original representation is:
391-
/// typedef void (kmpc_micro)(kmp_int32 global_tid, kmp_int32 bound_tid,...);
392-
llvm::FunctionType *Kmpc_MicroTy = nullptr;
393389
/// Stores debug location and ThreadID for the function.
394390
struct DebugLocThreadIdTy {
395391
llvm::Value *DebugLoc;

clang/lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ ItaniumCXXABI::EmitMemberPointerConversion(CodeGenFunction &CGF,
953953
Builder.CreateCondBr(IsVirtualOffset, MergeBB, ResignBB);
954954

955955
CGF.EmitBlock(ResignBB);
956-
llvm::Type *PtrTy = llvm::PointerType::getUnqual(CGM.Int8Ty);
956+
llvm::Type *PtrTy = llvm::PointerType::getUnqual(CGM.getLLVMContext());
957957
MemFnPtr = Builder.CreateIntToPtr(MemFnPtr, PtrTy);
958958
MemFnPtr =
959959
CGF.emitPointerAuthResign(MemFnPtr, SrcType, CurAuthInfo, NewAuthInfo,

0 commit comments

Comments
 (0)