[llvm] [IR] Deprecate PointerType::get/getUnqual pointee type overload (PR #134517)
Mats Jun Larsen via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 5 19:27:08 PDT 2025
https://github.com/junlarsen created https://github.com/llvm/llvm-project/pull/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.
Part of #123569
>From 58d92f58cfb2b91e1a0bfb380f9394b853334382 Mon Sep 17 00:00:00 2001
From: Mats Jun Larsen <mats at jun.codes>
Date: Mon, 31 Mar 2025 23:54:53 +0200
Subject: [PATCH] [IR] Deprecate PointerType::get/getUnqual pointee type
overload
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/include/llvm/IR/DerivedTypes.h | 6 ++++++
1 file changed, 6 insertions(+)
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);
}
More information about the llvm-commits
mailing list