void SetParent(Function* function) { function_ = function; }
// Appends an instruction to this basic block.
inline void AddInstruction(std::unique_ptr<Instruction> i);
+ // The label starting this basic block.
+ Instruction& Label() { return *label_; }
iterator begin() { return iterator(&insts_, insts_.begin()); }
iterator end() { return iterator(&insts_, insts_.end()); }
// Creates a function instance declared by the given OpFunction instruction
// |def_inst|.
inline explicit Function(std::unique_ptr<Instruction> def_inst);
+ // The OpFunction instruction that begins the definition of this function.
+ Instruction& DefInst() { return *def_inst_; }
// Sets the enclosing module for this function.
void SetParent(Module* module) { module_ = module; }
void SetHeader(const ModuleHeader& header) { header_ = header; }
// Sets the Id bound.
void SetIdBound(uint32_t bound) { header_.bound = bound; }
+ // Returns the Id bound.
+ uint32_t IdBound() { return header_.bound; }
// Appends a capability instruction to this module.
inline void AddCapability(std::unique_ptr<Instruction> c);
// Appends an extension instruction to this module.
bool IsSame(Type* that) const override;
std::string str() const override;
const Type* element_type() const { return element_type_; }
+ uint32_t LengthId() const { return length_id_; }
Array* AsArray() override { return this; }
const Array* AsArray() const override { return this; }
bool IsSame(Type* that) const override;
std::string str() const override;
+ const std::vector<Type*>& element_types() const { return element_types_; }
bool decoration_empty() const override {
return decorations_.empty() && element_decorations_.empty();
}