Added the -m option as an alias for -format=darwin to llvm-nm and llvm-size

which is what the darwin tools use for the Mach-O format output.

llvm-svn: 211326
This commit is contained in:
Kevin Enderby 2014-06-20 00:04:16 +00:00
parent 562e0d8023
commit 14a96ac343
4 changed files with 6 additions and 2 deletions

View File

@ -2,7 +2,7 @@ RUN: llvm-nm -format darwin %p/Inputs/darwin-m-test1.mach0-armv7 \
RUN: | FileCheck %s -check-prefix test1
RUN: llvm-nm -format darwin %p/Inputs/darwin-m-test2.macho-i386 \
RUN: | FileCheck %s -check-prefix test2
RUN: llvm-nm -format darwin %p/Inputs/darwin-m-test3.macho-x86-64 \
RUN: llvm-nm -m %p/Inputs/darwin-m-test3.macho-x86-64 \
RUN: | FileCheck %s -check-prefix test3
# This is testing that the various bits in the n_desc feild are correct

View File

@ -8,7 +8,7 @@ RUN: llvm-size %p/Inputs/macho-archive-x86_64.a \
RUN: | FileCheck %s -check-prefix AR
RUN: llvm-size -format darwin %p/Inputs/macho-archive-x86_64.a \
RUN: | FileCheck %s -check-prefix mAR
RUN: llvm-size -format darwin -x -l %p/Inputs/hello-world.macho-x86_64 \
RUN: llvm-size -m -x -l %p/Inputs/hello-world.macho-x86_64 \
RUN: | FileCheck %s -check-prefix mxl
RUN: llvm-size %p/Inputs/macho-universal.x86_64.i386 \
RUN: | FileCheck %s -check-prefix u

View File

@ -81,6 +81,7 @@ cl::alias ExternalOnly2("g", cl::desc("Alias for --extern-only"),
cl::opt<bool> BSDFormat("B", cl::desc("Alias for --format=bsd"));
cl::opt<bool> POSIXFormat("P", cl::desc("Alias for --format=posix"));
cl::opt<bool> DarwinFormat("m", cl::desc("Alias for --format=darwin"));
cl::opt<bool> PrintFileName(
"print-file-name",
@ -828,6 +829,8 @@ int main(int argc, char **argv) {
OutputFormat = bsd;
if (POSIXFormat)
OutputFormat = posix;
if (DarwinFormat)
OutputFormat = darwin;
// The relative order of these is important. If you pass --size-sort it should
// only print out the size. However, if you pass -S --size-sort, it should

View File

@ -46,6 +46,7 @@ static cl::opt<OutputFormatTy>
OutputFormatShort(cl::desc("Specify output format"),
cl::values(clEnumValN(sysv, "A", "System V format"),
clEnumValN(berkeley, "B", "Berkeley format"),
clEnumValN(darwin, "m", "Darwin -m format"),
clEnumValEnd),
cl::init(berkeley));