[llvm] [IR] Deprecate PointerType::get/getUnqual pointee type overload (PR #134517)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 5 19:27:40 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Mats Jun Larsen (junlarsen)
<details>
<summary>Changes</summary>
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
---
Full diff: https://github.com/llvm/llvm-project/pull/134517.diff
1 Files Affected:
- (modified) llvm/include/llvm/IR/DerivedTypes.h (+6)
``````````diff
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);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/134517
More information about the llvm-commits
mailing list