-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[IR] Deprecate PointerType::get/getUnqual pointee type overload #134517
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
[IR] Deprecate PointerType::get/getUnqual pointee type overload #134517
Conversation
Deprecates the methods and schedules them for removal in the future as the overloads taking LLVMContext are preferred, as the pointee type has no meaning in opaque pointers. Part of #123569
@llvm/pr-subscribers-llvm-ir Author: Mats Jun Larsen (junlarsen) ChangesDeprecates the methods and schedules them for removal in the future as Part of #123569 Full diff: https://github.com/llvm/llvm-project/pull/134517.diff 1 Files Affected:
diff --git a/llvm/include/llvm/IR/DerivedTypes.h b/llvm/include/llvm/IR/DerivedTypes.h
index 60606d34c32c3..cc6230287bfe4 100644
--- a/llvm/include/llvm/IR/DerivedTypes.h
+++ b/llvm/include/llvm/IR/DerivedTypes.h
@@ -685,6 +685,9 @@ class PointerType : public Type {
/// This constructs a pointer to an object of the specified type in a numbered
/// address space.
+ LLVM_DEPRECATED("PointerType::get with pointee type is pending removal. Use "
+ "Context overload.",
+ "PointerType::get(LLVMContext, AS)")
static PointerType *get(Type *ElementType, unsigned AddressSpace);
/// This constructs an opaque pointer to an object in a numbered address
/// space.
@@ -692,6 +695,9 @@ class PointerType : public Type {
/// This constructs a pointer to an object of the specified type in the
/// default address space (address space zero).
+ LLVM_DEPRECATED("PointerType::getUnqual with pointee type is pending "
+ "removal. Use Context overload.",
+ "PointerType::getUnqual(LLVMCOntext)")
static PointerType *getUnqual(Type *ElementType) {
return PointerType::get(ElementType, 0);
}
|
llvm/include/llvm/IR/DerivedTypes.h
Outdated
@@ -685,13 +685,19 @@ class PointerType : public Type { | |||
|
|||
/// This constructs a pointer to an object of the specified type in a numbered | |||
/// address space. | |||
LLVM_DEPRECATED("PointerType::get with pointee type is pending removal. Use " | |||
"Context overload.", | |||
"PointerType::get(LLVMContext, AS)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use [[deprecated]]
instead. Only use LLVM_DEPRECATED if you can actually provide a working fixit, which you can't do here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the heads up! Taken care of in b3c03d6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/134/builds/16395 Here is the relevant piece of the build log for the reference
|
static PointerType *get(Type *ElementType, unsigned AddressSpace); | ||
/// This constructs an opaque pointer to an object in a numbered address | ||
/// space. | ||
static PointerType *get(LLVMContext &C, unsigned AddressSpace); | ||
|
||
/// This constructs a pointer to an object of the specified type in the | ||
/// default address space (address space zero). | ||
[[deprecated("PointerType::getUnqual with pointee type is pending removal. " | ||
"Use Context overload.")]] | ||
static PointerType *getUnqual(Type *ElementType) { | ||
return PointerType::get(ElementType, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junlarsen MSVC is warning because this is calling the now deprecated llvm.PointerType.get() variant - would it be possible for you to update this to call the LLVMContext variant directly to silence the warning and allow us to re-enable Werror builds please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll do that.
The major changes come from the following PRs: * llvm/llvm-project#131226 * llvm/llvm-project#134264 * llvm/llvm-project#134169 * llvm/llvm-project#134517 --------- Signed-off-by: MaheshRavishankar <[email protected]> Signed-off-by: Jakub Kuderski <[email protected]> Co-authored-by: MaheshRavishankar <[email protected]>
Local branch origin/amd-gfx b969d46 Merged main:94821ce45fe9 into origin/amd-gfx:6bc8f8a713b9 Remote branch main 146ad71 [IR] Deprecate PointerType::get/getUnqual pointee type overload (llvm#134517)
Deprecates the methods and schedules them for removal in the future as
the overloads taking LLVMContext are preferred, as the pointee type
has no meaning in opaque pointers.
From what my clangd can tell, there are no usages left in the monorepo
Part of #123569