From 03e4351013c133a3aabe3d7b9cded9d3153764f0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 17 Jul 2021 17:09:43 +0200 Subject: [PATCH] [IRBuilder] Deprecate CreateConstGEP1_32() without element type 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/IR/IRBuilder.h b/llvm/include/llvm/IR/IRBuilder.h index 4a5c03d..0c7843b 100644 --- a/llvm/include/llvm/IR/IRBuilder.h +++ b/llvm/include/llvm/IR/IRBuilder.h @@ -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); -- 2.7.4