[llvm] [MIRPrinter] Don't print line break when there is no instructions (PR #80147)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 09:02:28 PST 2024


================
@@ -728,7 +728,7 @@ void MIPrinter::print(const MachineBasicBlock &MBB) {
     HasLineAttributes = true;
   }
 
-  if (HasLineAttributes)
+  if (HasLineAttributes && !MBB.instrs().empty())
----------------
jayfoad wrote:

Makes sense to me: you only need the blank line separator if there are some successors/liveins *and* some instructions.

https://github.com/llvm/llvm-project/pull/80147


More information about the llvm-commits mailing list