lab3 some notations

main
XhyDds 2 years ago
parent 15b1ac4fad
commit ab63bbaf96

@ -11,7 +11,38 @@ namespace IR
// to store state
// store temporary value
Ptr<Value> tmp_val = nullptr;
Value *tmp_val = nullptr;
// 变量类别
Type *var_type = nullptr;
// 左值标记
bool sign_lvalue = false;
// 当前的函数
Function *cur_fun = nullptr;
// struct true_false_BB {
// BasicBlock *trueBB = nullptr;
// BasicBlock *falseBB = nullptr;
// };
// //if和while的分支栈可能用于短路计算
// std::list<true_false_BB> Cond_Stack;
struct while_false_BB {
BasicBlock *whileBB = nullptr;
BasicBlock *falseBB = nullptr;
};
// (while,false)栈用于break,continue
std::list<while_false_BB> While_Stack;
//正在构建的基本块栈
std::vector<BasicBlock *> cur_bb_list;
//函数参数产生于FuncParam用于FuncDef
std::vector<SyntaxTree::FuncParam> func_params;
//初始值栈产生于InitVal用于Vardef
std::vector<Constant *> init_val;
//ret BB
BasicBlock *ret_BB;
Value *ret_addr;
// types
Ptr<Type> VOID_T;

Loading…
Cancel
Save