refactor(dev): 统一 IR/MIR 接口命名风格

This commit is contained in:
Lane0218
2026-03-12 15:17:02 +08:00
parent f26551a896
commit b1155d8fa9
18 changed files with 170 additions and 167 deletions

View File

@@ -8,15 +8,15 @@ namespace ir {
Value::Value(std::shared_ptr<Type> ty, std::string name)
: type_(std::move(ty)), name_(std::move(name)) {}
const std::shared_ptr<Type>& Value::type() const { return type_; }
const std::shared_ptr<Type>& Value::GetType() const { return type_; }
const std::string& Value::name() const { return name_; }
const std::string& Value::GetName() const { return name_; }
void Value::set_name(std::string n) { name_ = std::move(n); }
void Value::SetName(std::string n) { name_ = std::move(n); }
void Value::AddUser(Instruction* user) { users_.push_back(user); }
const std::vector<Instruction*>& Value::users() const { return users_; }
const std::vector<Instruction*>& Value::GetUsers() const { return users_; }
ConstantInt::ConstantInt(std::shared_ptr<Type> ty, int v)
: Value(std::move(ty), ""), value_(v) {}