Skip to content

Commit ca161e0

Browse files
committed
[IRBuilder] Deprecate CreateStructGEP() without element type
This API is incompatible with opaque pointers and deprecated in favor of the version that accepts an explicit element type.
1 parent 4ace600 commit ca161e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/include/llvm/IR/IRBuilder.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,9 @@ class IRBuilderBase {
19881988
return CreateConstInBoundsGEP2_32(Ty, Ptr, 0, Idx, Name);
19891989
}
19901990

1991-
Value *CreateStructGEP(Value *Ptr, unsigned Idx, const Twine &Name = "") {
1991+
LLVM_ATTRIBUTE_DEPRECATED(
1992+
Value *CreateStructGEP(Value *Ptr, unsigned Idx, const Twine &Name = ""),
1993+
"Use the version with explicit element type instead") {
19921994
return CreateConstInBoundsGEP2_32(
19931995
Ptr->getType()->getScalarType()->getPointerElementType(), Ptr, 0, Idx,
19941996
Name);

0 commit comments

Comments
 (0)