[midend]解决标签重名问题

This commit is contained in:
rain2133
2025-07-25 12:35:35 +08:00
parent d50912ee4c
commit 12f63a0bf5
3 changed files with 3 additions and 5 deletions

View File

@@ -150,9 +150,7 @@ void SysYPrinter::printFunction(Function *function) {
for (const auto &blockIter : function->getBasicBlocks()) {
// Basic block label
BasicBlock* blockPtr = blockIter.get();
if (blockPtr == function->getEntryBlock()) {
std::cout << "entry:" << std::endl;
} else if (!blockPtr->getName().empty()) {
if (!blockPtr->getName().empty()) {
std::cout << blockPtr->getName() << ":" << std::endl;
}