From 0ecd47f0ac8c9d2b59e0d2b644b40f7e31c21d37 Mon Sep 17 00:00:00 2001 From: CGH0S7 <776459475@qq.com> Date: Sun, 3 Aug 2025 22:23:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DIR=E6=89=93=E5=8D=B0=E5=99=A8?= =?UTF-8?q?=E4=B8=AD=E6=B5=AE=E7=82=B9=E6=AF=94=E8=BE=83=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF=EF=BC=8C=E7=A1=AE?= =?UTF-8?q?=E4=BF=9D=E7=94=9F=E6=88=90=E6=AD=A3=E7=A1=AE=E7=9A=84LLVM=20IR?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/midend/SysYIRPrinter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/midend/SysYIRPrinter.cpp b/src/midend/SysYIRPrinter.cpp index 9a0f427..fba6abd 100644 --- a/src/midend/SysYIRPrinter.cpp +++ b/src/midend/SysYIRPrinter.cpp @@ -299,7 +299,12 @@ void SysYPrinter::printInst(Instruction *pInst) { // Types and operands std::cout << " "; - printType(binInst->getType()); + // For comparison operations, print operand types instead of result type + if (pInst->getKind() >= Kind::kICmpEQ && pInst->getKind() <= Kind::kFCmpGE) { + printType(binInst->getLhs()->getType()); + } else { + printType(binInst->getType()); + } std::cout << " "; printValue(binInst->getLhs()); std::cout << ", ";