[llvm] f95d260 - [IRBuilder] Deprecate CreateInBoundsGEP() without element type

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 17 12:27:36 PDT 2021


Author: Nikita Popov
Date: 2021-07-17T21:27:16+02:00
New Revision: f95d26006e0641385565774ca4b560cc72a84e2f

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

LOG: [IRBuilder] Deprecate CreateInBoundsGEP() 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 3dc72c4388b0..8e76bb210537 100644
--- a/llvm/include/llvm/IR/IRBuilder.h
+++ b/llvm/include/llvm/IR/IRBuilder.h
@@ -1804,8 +1804,10 @@ class IRBuilderBase {
     return Insert(GetElementPtrInst::Create(Ty, Ptr, IdxList), Name);
   }
 
-  Value *CreateInBoundsGEP(Value *Ptr, ArrayRef<Value *> IdxList,
-                           const Twine &Name = "") {
+  LLVM_ATTRIBUTE_DEPRECATED(
+      Value *CreateInBoundsGEP(Value *Ptr, ArrayRef<Value *> IdxList,
+                               const Twine &Name = ""),
+      "Use the version with explicit element type instead") {
     return CreateInBoundsGEP(
         Ptr->getType()->getScalarType()->getPointerElementType(), Ptr, IdxList,
         Name);


        


More information about the llvm-commits mailing list