#ifndef _SYSYF_USER_H_ #define _SYSYF_USER_H_ #include "Value.h" #include // #include namespace SysYF { namespace IR { class User : public Value { public: ~User() = default; PtrVec& get_operands(); // start from 0 Ptr get_operand(unsigned i) const; // start from 0 void set_operand(unsigned i, Ptr v); void add_operand(Ptr v); unsigned get_num_operand() const; void remove_use_of_ops(); void remove_operands(int index1,int index2); protected: explicit User(Ptr ty, const std::string &name = "", unsigned num_ops = 0); private: PtrVec operands_; // operands of this value unsigned num_ops_; }; } } #endif // _SYSYF_USER_H_