style(ir): 纠正代码位置

This commit is contained in:
jing
2026-03-11 22:08:27 +08:00
parent 62dde8d7ab
commit fab6983d40
17 changed files with 193 additions and 88 deletions

View File

@@ -5,6 +5,19 @@
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::string& Value::name() const { return name_; }
void Value::set_name(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_; }
ConstantInt::ConstantInt(int v) : Value(Type::Int32(), ""), value_(v) {}
} // namespace ir