Skip to content

Commit 94fad11

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

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
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: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,16 +1475,6 @@ llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() {
14751475
return OMPBuilder.IdentPtr;
14761476
}
14771477

1478-
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);
1486-
}
1487-
14881478
static llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseKind
14891479
convertDeviceClause(const VarDecl *VD) {
14901480
std::optional<OMPDeclareTargetDeclAttr::DevTypeTy> DevTy =
@@ -1861,7 +1851,7 @@ void CGOpenMPRuntime::emitParallelCall(CodeGenFunction &CGF, SourceLocation Loc,
18611851
llvm::Value *Args[] = {
18621852
RTLoc,
18631853
CGF.Builder.getInt32(CapturedVars.size()), // Number of captured vars
1864-
CGF.Builder.CreateBitCast(OutlinedFn, RT.getKmpc_MicroPointerTy())};
1854+
OutlinedFn};
18651855
llvm::SmallVector<llvm::Value *, 16> RealArgs;
18661856
RealArgs.append(std::begin(Args), std::end(Args));
18671857
RealArgs.append(CapturedVars.begin(), CapturedVars.end());
@@ -9937,7 +9927,7 @@ void CGOpenMPRuntime::emitTeamsCall(CodeGenFunction &CGF,
99379927
llvm::Value *Args[] = {
99389928
RTLoc,
99399929
CGF.Builder.getInt32(CapturedVars.size()), // Number of captured vars
9940-
CGF.Builder.CreateBitCast(OutlinedFn, getKmpc_MicroPointerTy())};
9930+
OutlinedFn};
99419931
llvm::SmallVector<llvm::Value *, 16> RealArgs;
99429932
RealArgs.append(std::begin(Args), std::end(Args));
99439933
RealArgs.append(CapturedVars.begin(), CapturedVars.end());

clang/lib/CodeGen/CGOpenMPRuntime.h

Lines changed: 0 additions & 7 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;
@@ -530,9 +526,6 @@ class CGOpenMPRuntime {
530526
/// Build type kmp_routine_entry_t (if not built yet).
531527
void emitKmpRoutineEntryT(QualType KmpInt32Ty);
532528

533-
/// Returns pointer to kmpc_micro type.
534-
llvm::Type *getKmpc_MicroPointerTy();
535-
536529
/// If the specified mangled name is not in the module, create and
537530
/// return threadprivate cache object. This object is a pointer's worth of
538531
/// storage that's reserved for use by the OpenMP runtime.

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)