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