9#ifndef LLVM_SANDBOXIR_BASICBLOCK_H
10#define LLVM_SANDBOXIR_BASICBLOCK_H
26 using difference_type = std::ptrdiff_t;
28 using pointer = value_type *;
29 using reference = value_type &;
30 using iterator_category = std::bidirectional_iterator_tag;
39 BBIterator() : BB(nullptr), Ctx(nullptr) {}
41 : BB(BB), It(It), Ctx(Ctx) {}
42 reference
operator*()
const {
return *getInstr(It); }
44 BBIterator operator++(
int) {
55 bool operator==(
const BBIterator &Other)
const {
56 assert(Ctx ==
Other.Ctx &&
"BBIterators in different context!");
57 return It ==
Other.It;
59 bool operator!=(
const BBIterator &Other)
const {
return !(*
this ==
Other); }
62 pointer
get()
const {
return getInstr(It); }
71 LLVM_ABI void buildBasicBlockFromLLVMIR(llvm::BasicBlock *LLVMBB);
77 buildBasicBlockFromLLVMIR(BB);
91 return iterator(BB, BB->end(), &Ctx);
93 std::reverse_iterator<iterator>
rbegin()
const {
94 return std::make_reverse_iterator(
end());
96 std::reverse_iterator<iterator>
rend()
const {
97 return std::make_reverse_iterator(
begin());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
bool operator==(const MergedFunctionsInfo &LHS, const MergedFunctionsInfo &RHS)
LLVM Basic Block Representation.
InstListType::iterator iterator
Instruction iterators...
This class implements an extremely fast bulk output stream that can only output to a stream.
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
A SandboxIR Value has users. This is the base class.
ClassID getSubclassID() const
ArchKind & operator--(ArchKind &Kind)
@ BasicBlock
Various leaf nodes.
LLVM_ABI Function * getParent() const
Context & getContext() const
std::reverse_iterator< iterator > rbegin() const
BasicBlock(llvm::BasicBlock *BB, Context &SBCtx)
static bool classof(const Value *From)
For isa/dyn_cast.
friend class Instruction
Iterator for Instructions in a `BasicBlock.
LLVM_ABI Instruction & back() const
std::reverse_iterator< iterator > rend() const
void dumpOS(raw_ostream &OS) const final
void verify() const final
LLVM_ABI iterator begin() const
LLVM_ABI Instruction * getTerminator() const
LLVM_ABI Instruction & front() const
APInt operator*(APInt a, uint64_t RHS)
bool operator!=(uint64_t V1, const APInt &V2)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.