Fix a bug with llvm-size and the -m option with multiple files not printing the file names.

llvm-svn: 288402
This commit is contained in:
Kevin Enderby 2016-12-01 19:12:55 +00:00
parent 6a8704c1c0
commit 5997c9480b
3 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@ -1,7 +1,11 @@
RUN: llvm-size -m %p/Inputs/darwin-m.o | FileCheck --check-prefix="DARWIN" %s
RUN: llvm-size -m %p/Inputs/darwin-m.o %p/Inputs/darwin-m1.o | FileCheck --check-prefix="DARWIN2" %s
DARWIN: Segment : 8
DARWIN-NEXT: Section (__TEXT, __text): 4
DARWIN-NEXT: Section (__DATA, __data): 4
DARWIN-NEXT: total 8
DARWIN-NEXT: total 8
DARWIN2: Inputs/darwin-m.o:
DARWIN2: Inputs/darwin-m1.o:

View File

@ -817,11 +817,13 @@ static void printFileSectionSizes(StringRef file) {
} else if (ObjectFile *o = dyn_cast<ObjectFile>(&Bin)) {
if (!checkMachOAndArchFlags(o, file))
return;
MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o);
if (OutputFormat == sysv)
outs() << o->getFileName() << " :\n";
else if (MachO && OutputFormat == darwin && MoreThanOneFile)
outs() << o->getFileName() << ":\n";
printObjectSectionSizes(o);
if (OutputFormat == berkeley) {
MachOObjectFile *MachO = dyn_cast<MachOObjectFile>(o);
if (!MachO || MoreThanOneFile)
outs() << o->getFileName();
outs() << "\n";