[PATCH] D39539: [llvm-nm] Don't error out on multiple occurrances of the -g/--external-only flag
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 2 17:31:14 PDT 2017
LGTM
Martin Storsjö via Phabricator <reviews at reviews.llvm.org> writes:
> mstorsjo updated this revision to Diff 121358.
> mstorsjo retitled this revision from "[Support] Don't error out on multiple occurrances of an Optional flag" to "[llvm-nm] Don't error out on multiple occurrances of the -g/--external-only flag".
> mstorsjo edited the summary of this revision.
> mstorsjo added a comment.
>
> Changed the type of this option instead.
>
>
> https://reviews.llvm.org/D39539
>
> Files:
> test/tools/llvm-nm/X86/externalonly.test
> tools/llvm-nm/llvm-nm.cpp
>
>
> Index: tools/llvm-nm/llvm-nm.cpp
> ===================================================================
> --- tools/llvm-nm/llvm-nm.cpp
> +++ tools/llvm-nm/llvm-nm.cpp
> @@ -85,9 +85,11 @@
> cl::aliasopt(DefinedOnly), cl::Grouping);
>
> cl::opt<bool> ExternalOnly("extern-only",
> - cl::desc("Show only external symbols"));
> + cl::desc("Show only external symbols"),
> + cl::ZeroOrMore);
> cl::alias ExternalOnly2("g", cl::desc("Alias for --extern-only"),
> - cl::aliasopt(ExternalOnly), cl::Grouping);
> + cl::aliasopt(ExternalOnly), cl::Grouping,
> + cl::ZeroOrMore);
>
> cl::opt<bool> BSDFormat("B", cl::desc("Alias for --format=bsd"),
> cl::Grouping);
> Index: test/tools/llvm-nm/X86/externalonly.test
> ===================================================================
> --- test/tools/llvm-nm/X86/externalonly.test
> +++ test/tools/llvm-nm/X86/externalonly.test
> @@ -1,4 +1,5 @@
> # RUN: llvm-nm -g %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
> +# RUN: llvm-nm -g -g %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
>
> # CHECK-NOT: EH_frame0
> # CHECK: _main
>
>
> Index: tools/llvm-nm/llvm-nm.cpp
> ===================================================================
> --- tools/llvm-nm/llvm-nm.cpp
> +++ tools/llvm-nm/llvm-nm.cpp
> @@ -85,9 +85,11 @@
> cl::aliasopt(DefinedOnly), cl::Grouping);
>
> cl::opt<bool> ExternalOnly("extern-only",
> - cl::desc("Show only external symbols"));
> + cl::desc("Show only external symbols"),
> + cl::ZeroOrMore);
> cl::alias ExternalOnly2("g", cl::desc("Alias for --extern-only"),
> - cl::aliasopt(ExternalOnly), cl::Grouping);
> + cl::aliasopt(ExternalOnly), cl::Grouping,
> + cl::ZeroOrMore);
>
> cl::opt<bool> BSDFormat("B", cl::desc("Alias for --format=bsd"),
> cl::Grouping);
> Index: test/tools/llvm-nm/X86/externalonly.test
> ===================================================================
> --- test/tools/llvm-nm/X86/externalonly.test
> +++ test/tools/llvm-nm/X86/externalonly.test
> @@ -1,4 +1,5 @@
> # RUN: llvm-nm -g %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
> +# RUN: llvm-nm -g -g %p/Inputs/hello.obj.macho-x86_64 | FileCheck %s
>
> # CHECK-NOT: EH_frame0
> # CHECK: _main
More information about the llvm-commits
mailing list