Skip to content

Commit

Permalink
[IRBuilder] Remove redundant createGEP() overloads (NFC)
Browse files Browse the repository at this point in the history
ArrayRef<Value *> also accepts a single Value *, there's no need
to create separate overloads for this.
  • Loading branch information
nikic committed May 13, 2022
1 parent 1de7362 commit 0485211
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions llvm/include/llvm/IR/IRBuilder.h
Expand Up @@ -1736,19 +1736,6 @@ class IRBuilderBase {
return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, IdxList), Name);
}

Value *CreateGEP(Type *Ty, Value *Ptr, Value *Idx, const Twine &Name = "") {
if (auto *V = Folder.FoldGEP(Ty, Ptr, {Idx}, /*IsInBounds=*/false))
return V;
return Insert(GetElementPtrInst::Create(Ty, Ptr, Idx), Name);
}

Value *CreateInBoundsGEP(Type *Ty, Value *Ptr, Value *Idx,
const Twine &Name = "") {
if (auto *V = Folder.FoldGEP(Ty, Ptr, {Idx}, /*IsInBounds=*/true))
return V;
return Insert(GetElementPtrInst::CreateInBounds(Ty, Ptr, Idx), Name);
}

Value *CreateConstGEP1_32(Type *Ty, Value *Ptr, unsigned Idx0,
const Twine &Name = "") {
Value *Idx = ConstantInt::get(Type::getInt32Ty(Context), Idx0);
Expand Down

0 comments on commit 0485211

Please sign in to comment.