aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MIRPrinter.cpp
diff options
context:
space:
mode:
authorQuentin Dian <dianqk@dianqk.net>2024-02-01 22:10:52 +0800
committerGitHub <noreply@github.com>2024-02-01 22:10:52 +0800
commit112fba974ce42a6e552f7391d20a858a128283a1 (patch)
treeb0754dc7146deebba793f8ee15a9bfd7472363f9 /llvm/lib/CodeGen/MIRPrinter.cpp
parentc3eb2978a60b4e2e0cf9c8a8f9c51b48bd49477a (diff)
downloadllvm-112fba974ce42a6e552f7391d20a858a128283a1.zip
llvm-112fba974ce42a6e552f7391d20a858a128283a1.tar.gz
llvm-112fba974ce42a6e552f7391d20a858a128283a1.tar.bz2
[MIRPrinter] Don't print line break when there is no instructions (NFC) (#80147)
Per #80143, we can remove the extra line break when there is no instruction.
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index b1ad035..4ed44d1 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -728,7 +728,7 @@ void MIPrinter::print(const MachineBasicBlock &MBB) {
HasLineAttributes = true;
}
- if (HasLineAttributes)
+ if (HasLineAttributes && !MBB.empty())
OS << "\n";
bool IsInBundle = false;
for (const MachineInstr &MI : MBB.instrs()) {