[IRBuilder] Deprecate CreateConstGEP1_32() without element type
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 17 Jul 2021 15:09:43 +0000 (17:09 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 17 Jul 2021 16:32:36 +0000 (18:32 +0200)
This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.

llvm/include/llvm/IR/IRBuilder.h

index 4a5c03d..0c7843b 100644 (file)
@@ -1846,7 +1846,10 @@ public:
     return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, Idx), Name);
   }
 
-  Value *CreateConstGEP1_32(Value *Ptr, unsigned Idx0, const Twine &Name = "") {
+  LLVM_ATTRIBUTE_DEPRECATED(
+      Value *CreateConstGEP1_32(Value *Ptr, unsigned Idx0,
+                                const Twine &Name = ""),
+      "Use the version with explicit element type instead") {
     return CreateConstGEP1_32(
         Ptr->getType()->getScalarType()->getPointerElementType(), Ptr, Idx0,
         Name);