|
|
|
|
@ -119,10 +119,12 @@ std::any IRGenImpl::visitCompUnit(SysYParser::CompUnitContext* ctx) {
|
|
|
|
|
auto* putch = module_.CreateFunction("putch", ir::Type::GetVoidType(), true);
|
|
|
|
|
putch->AddParam("%arg.x", ir::Type::GetInt32Type());
|
|
|
|
|
function_map_["putch"] = putch;
|
|
|
|
|
function_map_["starttime"] =
|
|
|
|
|
module_.CreateFunction("starttime", ir::Type::GetVoidType(), true);
|
|
|
|
|
function_map_["stoptime"] =
|
|
|
|
|
module_.CreateFunction("stoptime", ir::Type::GetVoidType(), true);
|
|
|
|
|
auto* sysy_starttime = module_.CreateFunction("_sysy_starttime", ir::Type::GetVoidType(), true);
|
|
|
|
|
sysy_starttime->AddParam("%arg.lineno", ir::Type::GetInt32Type());
|
|
|
|
|
function_map_["starttime"] = sysy_starttime;
|
|
|
|
|
auto* sysy_stoptime = module_.CreateFunction("_sysy_stoptime", ir::Type::GetVoidType(), true);
|
|
|
|
|
sysy_stoptime->AddParam("%arg.lineno", ir::Type::GetInt32Type());
|
|
|
|
|
function_map_["stoptime"] = sysy_stoptime;
|
|
|
|
|
|
|
|
|
|
SysYParser::FuncDefContext* main_func = nullptr;
|
|
|
|
|
for (auto* func : funcs) {
|
|
|
|
|
|