mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Add convenience functions for creating inbounds GEPs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78695 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -493,6 +493,44 @@ public:
|
||||
return new(2) GetElementPtrInst(Ptr, Idx, NameStr, InsertAtEnd);
|
||||
}
|
||||
|
||||
/// Create an "inbounds" getelementptr. See the documentation for the
|
||||
/// "inbounds" flag in LangRef.html for details.
|
||||
template<typename InputIterator>
|
||||
static GetElementPtrInst *CreateInBounds(Value *Ptr, InputIterator IdxBegin,
|
||||
InputIterator IdxEnd,
|
||||
const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0) {
|
||||
GetElementPtrInst *GEP = Create(Ptr, IdxBegin, IdxEnd,
|
||||
NameStr, InsertBefore);
|
||||
cast<GEPOperator>(GEP)->setIsInBounds(true);
|
||||
return GEP;
|
||||
}
|
||||
template<typename InputIterator>
|
||||
static GetElementPtrInst *CreateInBounds(Value *Ptr,
|
||||
InputIterator IdxBegin,
|
||||
InputIterator IdxEnd,
|
||||
const Twine &NameStr,
|
||||
BasicBlock *InsertAtEnd) {
|
||||
GetElementPtrInst *GEP = Create(Ptr, IdxBegin, IdxEnd,
|
||||
NameStr, InsertAtEnd);
|
||||
cast<GEPOperator>(GEP)->setIsInBounds(true);
|
||||
return GEP;
|
||||
}
|
||||
static GetElementPtrInst *CreateInBounds(Value *Ptr, Value *Idx,
|
||||
const Twine &NameStr = "",
|
||||
Instruction *InsertBefore = 0) {
|
||||
GetElementPtrInst *GEP = Create(Ptr, Idx, NameStr, InsertBefore);
|
||||
cast<GEPOperator>(GEP)->setIsInBounds(true);
|
||||
return GEP;
|
||||
}
|
||||
static GetElementPtrInst *CreateInBounds(Value *Ptr, Value *Idx,
|
||||
const Twine &NameStr,
|
||||
BasicBlock *InsertAtEnd) {
|
||||
GetElementPtrInst *GEP = Create(Ptr, Idx, NameStr, InsertAtEnd);
|
||||
cast<GEPOperator>(GEP)->setIsInBounds(true);
|
||||
return GEP;
|
||||
}
|
||||
|
||||
virtual GetElementPtrInst *clone(LLVMContext &Context) const;
|
||||
|
||||
/// Transparently provide more efficient getOperand methods.
|
||||
|
Reference in New Issue
Block a user