-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CodeGen] Replace PointerType::getUnqual(Type) with opaque pointer version (NFC) #128711
Open
junlarsen
wants to merge
2
commits into
main
Choose a base branch
from
users/junlarsen/codegen_replace_pointertype_getunqual_type_with_opaque_pointer_version_nfc_
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[CodeGen] Replace PointerType::getUnqual(Type) with opaque pointer version (NFC) #128711
junlarsen
wants to merge
2
commits into
main
from
users/junlarsen/codegen_replace_pointertype_getunqual_type_with_opaque_pointer_version_nfc_
+3
−13
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pointer version (NFC) Follow-up to #123569
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@llvm/pr-subscribers-clang-codegen @llvm/pr-subscribers-clang Author: Mats Jun Larsen (junlarsen) Changespointer version (NFC) Follow-up to #123569 Full diff: https://github.com/llvm/llvm-project/pull/128711.diff 4 Files Affected:
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..7ff0d14b564fe 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1476,13 +1476,7 @@ llvm::Type *CGOpenMPRuntime::getIdentTyPointerTy() {
}
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);
+ return llvm::PointerType::getUnqual(CGM.getLLVMContext());
}
static llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseKind
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h
index 3791bb7159235..03a80d2bbc686 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;
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index bcd171724c41d..03c46a37717ab 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,
|
…getunqual_type_with_opaque_pointer_version_nfc_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
clang:codegen
clang:openmp
OpenMP related changes to Clang
clang
Clang issues not falling into any other category
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pointer version (NFC)
Follow-up to #123569