[PATCH] D43032: Add --build-id=fast as a synonym for --build-id.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 11:21:15 PST 2018


LGTM

Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:

> ruiu created this revision.
> ruiu added a reviewer: rafael.
> Herald added a subscriber: emaste.
>
> When you omit an argument, most options fall back to their defaults.
> For example, --color-diagnostics is a synonym for --color-diagnostics=auto.
> We don't have a way to specify the default choice for --build-id, so we
> can't describe --build-id (without an argument) in that way.
> This patch adds "fast" for the default build-id choice.
>
>
> https://reviews.llvm.org/D43032
>
> Files:
>   lld/ELF/Driver.cpp
>   lld/test/ELF/build-id.s
>
>
> Index: lld/test/ELF/build-id.s
> ===================================================================
> --- lld/test/ELF/build-id.s
> +++ lld/test/ELF/build-id.s
> @@ -7,6 +7,8 @@
>  
>  # RUN: ld.lld --build-id %t -o %t2 -threads
>  # RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
> +# RUN: ld.lld --build-id=fast %t -o %t2 -threads
> +# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
>  # RUN: ld.lld --build-id %t -o %t2 -no-threads
>  # RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
>  
> Index: lld/ELF/Driver.cpp
> ===================================================================
> --- lld/ELF/Driver.cpp
> +++ lld/ELF/Driver.cpp
> @@ -554,6 +554,8 @@
>      return {BuildIdKind::Fast, {}};
>  
>    StringRef S = Arg->getValue();
> +  if (S == "fast")
> +    return {BuildIdKind::Fast, {}};
>    if (S == "md5")
>      return {BuildIdKind::Md5, {}};
>    if (S == "sha1" || S == "tree")
>
>
> Index: lld/test/ELF/build-id.s
> ===================================================================
> --- lld/test/ELF/build-id.s
> +++ lld/test/ELF/build-id.s
> @@ -7,6 +7,8 @@
>  
>  # RUN: ld.lld --build-id %t -o %t2 -threads
>  # RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
> +# RUN: ld.lld --build-id=fast %t -o %t2 -threads
> +# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
>  # RUN: ld.lld --build-id %t -o %t2 -no-threads
>  # RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
>  
> Index: lld/ELF/Driver.cpp
> ===================================================================
> --- lld/ELF/Driver.cpp
> +++ lld/ELF/Driver.cpp
> @@ -554,6 +554,8 @@
>      return {BuildIdKind::Fast, {}};
>  
>    StringRef S = Arg->getValue();
> +  if (S == "fast")
> +    return {BuildIdKind::Fast, {}};
>    if (S == "md5")
>      return {BuildIdKind::Md5, {}};
>    if (S == "sha1" || S == "tree")


More information about the llvm-commits mailing list