1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

[llvm-size] print a blank line between archieve members when using sysv format

Summary: This patch is related to https://bugs.llvm.org/show_bug.cgi?id=42967 and it fixes llvm-size's sysv format output by adding a blank line between archieve members

Reviewers: jhenderson, Jim, MaskRay

Reviewed By: jhenderson, Jim, MaskRay

Subscribers: MaskRay, Jim, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71957
This commit is contained in:
TH3CHARLie 2020-01-03 14:04:01 +08:00 committed by Jim Lin
parent 01fa15d221
commit b0826b1f9c
4 changed files with 11 additions and 6 deletions

View File

@ -8,8 +8,7 @@
# RUN: llvm-ar rc %t1.a
# RUN: llvm-size -B %t1.a | count 0
## Sysv output prints a single blank line in this case.
# RUN: llvm-size -A %t1.a | FileCheck %s --implicit-check-not={{.}}
# RUN: llvm-size -A %t1.a | count 0
## Case 2: Single member.
# RUN: rm -f %t2.a
@ -48,6 +47,7 @@
# SYSV-3-NEXT: .bss 4 1
# SYSV-3-NEXT: Total 7
# SYSV-3-EMPTY:
# SYSV-3-EMPTY:
# SYSV-3-NEXT: archive.test.tmp1 (ex [[ARCHIVE2]]):
# SYSV-3-NEXT: section size addr
# SYSV-3-NEXT: .text 1 4
@ -55,6 +55,7 @@
# SYSV-3-NEXT: .bss 4 1
# SYSV-3-NEXT: Total 7
# SYSV-3-EMPTY:
# SYSV-3-EMPTY:
# SYSV-3-NEXT: [[FILE2]] :
# SYSV-3-NEXT: section size addr
# SYSV-3-NEXT: .text 8 32
@ -69,6 +70,8 @@
# SYSV-1-NEXT: .data 2 2
# SYSV-1-NEXT: .bss 4 1
# SYSV-1-NEXT: Total 7
# SYSV-1-EMPTY:
# SYSV-1-EMPTY:
# SYSV-2-NEXT: archive.test.tmp2 (ex [[ARCHIVE]]):
# SYSV-2-NEXT: section size addr

View File

@ -17,6 +17,7 @@
# SYSV-NEXT: .bss 4 1
# SYSV-NEXT: Total 7
# SYSV-EMPTY:
# SYSV-EMPTY:
# SYSV-NEXT: [[FILE2]] :
# SYSV-NEXT: section size addr
# SYSV-NEXT: .text 8 32

View File

@ -49,6 +49,7 @@
# OCT-SYSV-NEXT: .bss 04 01
# OCT-SYSV-NEXT: Total 07
# OCT-SYSV-EMPTY:
# OCT-SYSV-EMPTY:
# OCT-SYSV-NEXT: [[FILE2]] :
# OCT-SYSV-NEXT: section size addr
# OCT-SYSV-NEXT: .blob 010 040
@ -69,6 +70,7 @@
# DEC-SYSV-NEXT: .bss 4 1
# DEC-SYSV-NEXT: Total 7
# DEC-SYSV-EMPTY:
# DEC-SYSV-EMPTY:
# DEC-SYSV-NEXT: [[FILE2]] :
# DEC-SYSV-NEXT: section size addr
# DEC-SYSV-NEXT: .blob 8 32
@ -89,6 +91,7 @@
# HEX-SYSV-NEXT: .bss 0x4 0x1
# HEX-SYSV-NEXT: Total 0x7
# HEX-SYSV-EMPTY:
# HEX-SYSV-EMPTY:
# HEX-SYSV-NEXT: [[FILE2]] :
# HEX-SYSV-NEXT: section size addr
# HEX-SYSV-NEXT: .blob 0x8 0x20

View File

@ -446,7 +446,8 @@ static void printObjectSectionSizes(ObjectFile *Obj) {
fmt << "%-" << max_name_len << "s "
<< "%#" << max_size_len << radix_fmt << "\n";
outs() << format(fmt.str().c_str(), static_cast<const char *>("Total"),
total);
total)
<< "\n\n";
} else {
// The Berkeley format does not display individual section sizes. It
// displays the cumulative size for each section type.
@ -839,9 +840,6 @@ static void printFileSectionSizes(StringRef file) {
} else {
error("unsupported file type", file);
}
// System V adds an extra newline at the end of each file.
if (OutputFormat == sysv)
outs() << "\n";
}
static void printBerkeleyTotals() {