[lab3] add middle-end and backend with bugs to fix

This commit is contained in:
lixuanwang
2025-05-26 23:17:31 +08:00
parent 338e5ef9a4
commit dc7202849c
5 changed files with 44 additions and 31 deletions

View File

@@ -12,7 +12,7 @@ std::string SysYIRGenerator::generateIR(SysYParser::CompUnitContext* unit) {
}
std::string SysYIRGenerator::getNextTemp() {
std::string ret = "%" + std::to_string(tempCounter++);
std::string ret = "%." + std::to_string(tempCounter++);
tmpTable[ret] = "void";
return ret;
}