forked from NUDT-compiler/nudt-compiler-cpp
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.
20 lines
502 B
20 lines
502 B
// 极简类型系统:仅支持 void 与 i32。
|
|
|
|
// 还应该包含 f32、数组类型等
|
|
// - 参照SysY官方文档范围逐步补齐
|
|
#include "ir/IR.h"
|
|
|
|
namespace ir {
|
|
|
|
Type::Type(Kind k) : kind_(k) {}
|
|
|
|
Type::Kind Type::kind() const { return kind_; }
|
|
|
|
std::shared_ptr<Type> Type::Void() { return DefaultContext().Void(); }
|
|
|
|
std::shared_ptr<Type> Type::Int32() { return DefaultContext().Int32(); }
|
|
|
|
std::shared_ptr<Type> Type::PtrInt32() { return DefaultContext().PtrInt32(); }
|
|
|
|
} // namespace ir
|