[llvm] r288402 - Fix a bug with llvm-size and the -m option with multiple files not printing the file names.
Kevin Enderby via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 11:12:56 PST 2016
Author: enderby
Date: Thu Dec 1 13:12:55 2016
New Revision: 288402
URL: http://llvm.org/viewvc/llvm-project?rev=288402&view=rev
Log:
Fix a bug with llvm-size and the -m option with multiple files not printing the file names.
Added:
llvm/trunk/test/tools/llvm-size/Inputs/darwin-m1.o (with props)
Modified:
llvm/trunk/test/tools/llvm-size/darwin-m.test
llvm/trunk/tools/llvm-size/llvm-size.cpp
Added: llvm/trunk/test/tools/llvm-size/Inputs/darwin-m1.o
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-size/Inputs/darwin-m1.o?rev=288402&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/tools/llvm-size/Inputs/darwin-m1.o
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: llvm/trunk/test/tools/llvm-size/darwin-m.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-size/darwin-m.test?rev=288402&r1=288401&r2=288402&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-size/darwin-m.test (original)
+++ llvm/trunk/test/tools/llvm-size/darwin-m.test Thu Dec 1 13:12:55 2016
@@ -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:
Modified: llvm/trunk/tools/llvm-size/llvm-size.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-size/llvm-size.cpp?rev=288402&r1=288401&r2=288402&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-size/llvm-size.cpp (original)
+++ llvm/trunk/tools/llvm-size/llvm-size.cpp Thu Dec 1 13:12:55 2016
@@ -817,11 +817,13 @@ static void printFileSectionSizes(String
} 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";
More information about the llvm-commits
mailing list