llvm/llvm/include/llvm/IR/InstIterator.h

//===- InstIterator.h - Classes for inst iteration --------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file contains definitions of two iterators for iterating over the
// instructions in a function.  This is effectively a wrapper around a two level
// iterator that can probably be genericized later.
//
// Note that this iterator gets invalidated any time that basic blocks or
// instructions are moved around.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_IR_INSTITERATOR_H
#define LLVM_IR_INSTITERATOR_H

#include "llvm/ADT/iterator_range.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/SymbolTableListTraits.h"
#include <iterator>

namespace llvm {

// This class implements inst_begin() & inst_end() for
// inst_iterator and const_inst_iterator's.
//
template <class BB_t, class BB_i_t, class BI_t, class II_t> class InstIterator {};

inst_iterator;
const_inst_iterator;
inst_range;
const_inst_range;

inline inst_iterator inst_begin(Function *F) {}
inline inst_iterator inst_end(Function *F)   {}
inline inst_range instructions(Function *F) {}
inline const_inst_iterator inst_begin(const Function *F) {}
inline const_inst_iterator inst_end(const Function *F) {}
inline const_inst_range instructions(const Function *F) {}
inline inst_iterator inst_begin(Function &F) {}
inline inst_iterator inst_end(Function &F)   {}
inline inst_range instructions(Function &F) {}
inline const_inst_iterator inst_begin(const Function &F) {}
inline const_inst_iterator inst_end(const Function &F) {}
inline const_inst_range instructions(const Function &F) {}

} // end namespace llvm

#endif // LLVM_IR_INSTITERATOR_H