[clang] 94fad11 - [CodeGen] Replace PointerType::getUnqual(Type) with opaque pointer version (NFC) (#128711)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 3 14:00:35 PST 2025
Author: Mats Jun Larsen
Date: 2025-03-03T23:00:32+01:00
New Revision: 94fad113070878c37f00699ca9d74b6216910af5
URL: https://github.com/llvm/llvm-project/commit/94fad113070878c37f00699ca9d74b6216910af5
DIFF: https://github.com/llvm/llvm-project/commit/94fad113070878c37f00699ca9d74b6216910af5.diff
LOG: [CodeGen] Replace PointerType::getUnqual(Type) with opaque pointer version (NFC) (#128711)
pointer version (NFC)
Follow-up to #123569
Added:
Modified:
clang/lib/CodeGen/ABIInfoImpl.cpp
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGOpenMPRuntime.h
clang/lib/CodeGen/ItaniumCXXABI.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/ABIInfoImpl.cpp b/clang/lib/CodeGen/ABIInfoImpl.cpp
index 68887cd7916c7..0a612d3461dc2 100644
--- a/clang/lib/CodeGen/ABIInfoImpl.cpp
+++ b/clang/lib/CodeGen/ABIInfoImpl.cpp
@@ -430,7 +430,7 @@ Address CodeGen::EmitVAArgInstr(CodeGenFunction &CGF, Address VAListAddr,
CharUnits TyAlignForABI = TyInfo.Align;
llvm::Type *ElementTy = CGF.ConvertTypeForMem(Ty);
- llvm::Type *BaseTy = llvm::PointerType::getUnqual(ElementTy);
+ llvm::Type *BaseTy = llvm::PointerType::getUnqual(CGF.getLLVMContext());
llvm::Value *Addr =
CGF.Builder.CreateVAArg(VAListAddr.emitRawPointer(CGF), BaseTy);
return Address(Addr, ElementTy, TyAlignForABI);
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index c2289985e9519..cfb7439e43e29 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1475,16 +1475,6 @@ llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() {
return OMPBuilder.IdentPtr;
}
-llvm::Type *CGOpenMPRuntime::getKmpc_MicroPointerTy() {
- if (!Kmpc_MicroTy) {
- // Build void (*kmpc_micro)(kmp_int32 *global_tid, kmp_int32 *bound_tid,...)
- llvm::Type *MicroParams[] = {llvm::PointerType::getUnqual(CGM.Int32Ty),
- llvm::PointerType::getUnqual(CGM.Int32Ty)};
- Kmpc_MicroTy = llvm::FunctionType::get(CGM.VoidTy, MicroParams, true);
- }
- return llvm::PointerType::getUnqual(Kmpc_MicroTy);
-}
-
static llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseKind
convertDeviceClause(const VarDecl *VD) {
std::optional<OMPDeclareTargetDeclAttr::DevTypeTy> DevTy =
@@ -1861,7 +1851,7 @@ void CGOpenMPRuntime::emitParallelCall(CodeGenFunction &CGF, SourceLocation Loc,
llvm::Value *Args[] = {
RTLoc,
CGF.Builder.getInt32(CapturedVars.size()), // Number of captured vars
- CGF.Builder.CreateBitCast(OutlinedFn, RT.getKmpc_MicroPointerTy())};
+ OutlinedFn};
llvm::SmallVector<llvm::Value *, 16> RealArgs;
RealArgs.append(std::begin(Args), std::end(Args));
RealArgs.append(CapturedVars.begin(), CapturedVars.end());
@@ -9937,7 +9927,7 @@ void CGOpenMPRuntime::emitTeamsCall(CodeGenFunction &CGF,
llvm::Value *Args[] = {
RTLoc,
CGF.Builder.getInt32(CapturedVars.size()), // Number of captured vars
- CGF.Builder.CreateBitCast(OutlinedFn, getKmpc_MicroPointerTy())};
+ OutlinedFn};
llvm::SmallVector<llvm::Value *, 16> RealArgs;
RealArgs.append(std::begin(Args), std::end(Args));
RealArgs.append(CapturedVars.begin(), CapturedVars.end());
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h
index 3791bb7159235..4321712e1521d 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.h
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.h
@@ -386,10 +386,6 @@ class CGOpenMPRuntime {
/// Map for SourceLocation and OpenMP runtime library debug locations.
typedef llvm::DenseMap<SourceLocation, llvm::Value *> OpenMPDebugLocMapTy;
OpenMPDebugLocMapTy OpenMPDebugLocMap;
- /// The type for a microtask which gets passed to __kmpc_fork_call().
- /// Original representation is:
- /// typedef void (kmpc_micro)(kmp_int32 global_tid, kmp_int32 bound_tid,...);
- llvm::FunctionType *Kmpc_MicroTy = nullptr;
/// Stores debug location and ThreadID for the function.
struct DebugLocThreadIdTy {
llvm::Value *DebugLoc;
@@ -530,9 +526,6 @@ class CGOpenMPRuntime {
/// Build type kmp_routine_entry_t (if not built yet).
void emitKmpRoutineEntryT(QualType KmpInt32Ty);
- /// Returns pointer to kmpc_micro type.
- llvm::Type *getKmpc_MicroPointerTy();
-
/// If the specified mangled name is not in the module, create and
/// return threadprivate cache object. This object is a pointer's worth of
/// storage that's reserved for use by the OpenMP runtime.
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index bb9b6fd210667..7e26a0da3d7d2 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -953,7 +953,7 @@ ItaniumCXXABI::EmitMemberPointerConversion(CodeGenFunction &CGF,
Builder.CreateCondBr(IsVirtualOffset, MergeBB, ResignBB);
CGF.EmitBlock(ResignBB);
- llvm::Type *PtrTy = llvm::PointerType::getUnqual(CGM.Int8Ty);
+ llvm::Type *PtrTy = llvm::PointerType::getUnqual(CGM.getLLVMContext());
MemFnPtr = Builder.CreateIntToPtr(MemFnPtr, PtrTy);
MemFnPtr =
CGF.emitPointerAuthResign(MemFnPtr, SrcType, CurAuthInfo, NewAuthInfo,
More information about the cfe-commits
mailing list