Emit newline after IR-dump banner in PrintCallGraphPass (#199410)

Required for Compiler Explorer's opt-pipeline viewer: the tool parses
pass output by splitting on the IR-dump banner line, so the banner must
end with a newline. Without it, targets that exercise this pass cannot
be inspected through the opt-pipeline feature.

Assisted by Claude.
This commit is contained in:
Prerona Chaudhuri 2026-05-28 18:48:38 +05:30 committed by GitHub
parent 34f294ccbc
commit 7fb99eefbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -678,7 +678,7 @@ namespace {
auto PrintBannerOnce = [&]() {
if (BannerPrinted)
return;
OS << Banner;
OS << Banner << "\n";
BannerPrinted = true;
};

View file

@ -0,0 +1,11 @@
; RUN: llc -mtriple=x86_64-unknown-linux-gnu -enable-ipra \
; RUN: -print-after=DummyCGSCCPass -o - %s 2>&1 | FileCheck %s
; REQUIRES: x86-registered-target
; The legacy CallGraphSCCPass printer should emit the banner as its own line.
; CHECK-LABEL: *** IR Dump After DummyCGSCCPass (DummyCGSCCPass) ***
; CHECK-NEXT: define void @bar() {
define void @bar() {
ret void
}