]> granicus.if.org Git - llvm/commitdiff
Fix a bug with llvm-size and the -m option with multiple files not printing the file...
authorKevin Enderby <enderby@apple.com>
Thu, 1 Dec 2016 19:12:55 +0000 (19:12 +0000)
committerKevin Enderby <enderby@apple.com>
Thu, 1 Dec 2016 19:12:55 +0000 (19:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288402 91177308-0d34-0410-b5e6-96231b3b80d8

test/tools/llvm-size/Inputs/darwin-m1.o [new file with mode: 0644]
test/tools/llvm-size/darwin-m.test
tools/llvm-size/llvm-size.cpp

diff --git a/test/tools/llvm-size/Inputs/darwin-m1.o b/test/tools/llvm-size/Inputs/darwin-m1.o
new file mode 100644 (file)
index 0000000..9672df5
Binary files /dev/null and b/test/tools/llvm-size/Inputs/darwin-m1.o differ
index 23d636ba32bb912cefb8f046202dc4a124f2411d..ade1b724c6943a07081c014a20965950021d3a07 100644 (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:
index a11532a7c98d4d1b487b5c42212833da085c357c..903e950bc735417ffedd5017a0aa013a3b3f828d 100644 (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";