You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
767 B
35 lines
767 B
#ifndef _SYSY_USER_H_
|
|
#define _SYSY_USER_H_
|
|
|
|
#include "Value.h"
|
|
#include <vector>
|
|
// #include <memory>
|
|
|
|
class User : public Value
|
|
{
|
|
public:
|
|
User(Type *ty, const std::string &name = "", unsigned num_ops = 0);
|
|
~User() = default;
|
|
|
|
std::vector<Value *>& get_operands();
|
|
|
|
// start from 0
|
|
Value *get_operand(unsigned i) const;
|
|
|
|
// start from 0
|
|
void set_operand(unsigned i, Value *v);
|
|
void add_operand( Value *v);
|
|
|
|
unsigned get_num_operand() const;
|
|
|
|
void remove_use_of_ops();
|
|
void remove_operands(int index1,int index2);
|
|
|
|
private:
|
|
// std::unique_ptr< std::list<Value *> > operands_; // operands of this value
|
|
std::vector<Value *> operands_; // operands of this value
|
|
unsigned num_ops_;
|
|
};
|
|
|
|
#endif // _SYSY_USER_H_
|