[llvm] 7db463c - [IRBuilder] Deprecate CreateConstGEP2_64() without element type

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 17 07:42:06 PDT 2021


Author: Nikita Popov
Date: 2021-07-17T16:41:51+02:00
New Revision: 7db463ced55a481a4693c8da1d413606c97fab9e

URL: https://github.com/llvm/llvm-project/commit/7db463ced55a481a4693c8da1d413606c97fab9e
DIFF: https://github.com/llvm/llvm-project/commit/7db463ced55a481a4693c8da1d413606c97fab9e.diff

LOG: [IRBuilder] Deprecate CreateConstGEP2_64() without element type

This API is incompatible with opaque pointers and deprecated in
favor of the version that accepts an explicit element type.

Added: 
    

Modified: 
    llvm/include/llvm/IR/IRBuilder.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h
index bd7fa7f0caff..a0a56d173a3a 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -1944,8 +1944,10 @@ class IRBuilderBase {
     return Insert(GetElementPtrInst::Create(Ty, Ptr, Idxs), Name);
   }
 
-  Value *CreateConstGEP2_64(Value *Ptr, uint64_t Idx0, uint64_t Idx1,
-                            const Twine &Name = "") {
+  LLVM_ATTRIBUTE_DEPRECATED(
+      Value *CreateConstGEP2_64(Value *Ptr, uint64_t Idx0, uint64_t Idx1,
+                                const Twine &Name = ""),
+      "Use the version with explicit element type instead") {
     return CreateConstGEP2_64(
         Ptr->getType()->getScalarType()->getPointerElementType(), Ptr, Idx0,
         Idx1, Name);


        


More information about the llvm-commits mailing list