#ifndef SOURCE_OPT_FUNCTION_H_
#define SOURCE_OPT_FUNCTION_H_
#include <algorithm>
#include <functional>
#include <memory>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>
#include "source/opt/basic_block.h"
#include "source/opt/instruction.h"
#include "source/opt/iterator.h"
namespace spvtools {
namespace opt {
class CFG;
class IRContext;
class Module;
class Function { … };
std::ostream& operator<<(std::ostream& str, const Function& func);
inline Function::Function(std::unique_ptr<Instruction> def_inst)
: … { … }
inline void Function::AddParameter(std::unique_ptr<Instruction> p) { … }
inline void Function::AddDebugInstructionInHeader(
std::unique_ptr<Instruction> p) { … }
inline void Function::AddBasicBlock(std::unique_ptr<BasicBlock> b) { … }
inline void Function::AddBasicBlock(std::unique_ptr<BasicBlock> b,
iterator ip) { … }
template <typename T>
inline void Function::AddBasicBlocks(T src_begin, T src_end, iterator ip) { … }
inline void Function::MoveBasicBlockToAfter(uint32_t id, BasicBlock* ip) { … }
inline void Function::RemoveEmptyBlocks() { … }
inline void Function::RemoveParameter(uint32_t id) { … }
inline void Function::SetFunctionEnd(std::unique_ptr<Instruction> end_inst) { … }
inline void Function::AddNonSemanticInstruction(
std::unique_ptr<Instruction> non_semantic) { … }
template <class It>
void Function::ReorderBasicBlocks(It begin, It end) { … }
template <class It>
bool Function::ContainsAllBlocksInTheFunction(It begin, It end) { … }
}
}
#endif