修复IR打印器中浮点比较指令的类型错误,确保生成正确的LLVM IR代码
This commit is contained in:
@@ -299,7 +299,12 @@ void SysYPrinter::printInst(Instruction *pInst) {
|
|||||||
|
|
||||||
// Types and operands
|
// Types and operands
|
||||||
std::cout << " ";
|
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 << " ";
|
std::cout << " ";
|
||||||
printValue(binInst->getLhs());
|
printValue(binInst->getLhs());
|
||||||
std::cout << ", ";
|
std::cout << ", ";
|
||||||
|
|||||||
Reference in New Issue
Block a user