Lab6: fix operator precedence and resolve 64-bit pointer propagation in AArch64 lowering

This commit is contained in:
2026-06-28 15:39:00 +08:00
committed by CGH0S7
parent 0e9e2dd345
commit d1edad08e6
7 changed files with 384 additions and 200 deletions

View File

@@ -211,67 +211,25 @@ class SemaVisitor final : public SysYBaseVisitor {
return ctx->exp()->accept(this);
}
std::any visitMulExp(SysYParser::MulExpContext* ctx) override {
std::any visitMulDivModExp(SysYParser::MulDivModExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitDivExp(SysYParser::DivExpContext* ctx) override {
std::any visitAddSubExp(SysYParser::AddSubExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitModExp(SysYParser::ModExpContext* ctx) override {
std::any visitRelExp(SysYParser::RelExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitAddExp(SysYParser::AddExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitSubExp(SysYParser::SubExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitLtExp(SysYParser::LtExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitLeExp(SysYParser::LeExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitGtExp(SysYParser::GtExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitGeExp(SysYParser::GeExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitEqExp(SysYParser::EqExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};
}
std::any visitNeExp(SysYParser::NeExpContext* ctx) override {
std::any visitEqNeExp(SysYParser::EqNeExpContext* ctx) override {
ctx->exp(0)->accept(this);
ctx->exp(1)->accept(this);
return {};