[lld] r324502 - Add --build-id=fast as a synonym for --build-id.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 11:22:42 PST 2018


Author: ruiu
Date: Wed Feb  7 11:22:42 2018
New Revision: 324502

URL: http://llvm.org/viewvc/llvm-project?rev=324502&view=rev
Log:
Add --build-id=fast as a synonym for --build-id.

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.

Differential Revision: https://reviews.llvm.org/D43032

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/test/ELF/build-id.s

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=324502&r1=324501&r2=324502&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Feb  7 11:22:42 2018
@@ -554,6 +554,8 @@ getBuildId(opt::InputArgList &Args) {
     return {BuildIdKind::Fast, {}};
 
   StringRef S = Arg->getValue();
+  if (S == "fast")
+    return {BuildIdKind::Fast, {}};
   if (S == "md5")
     return {BuildIdKind::Md5, {}};
   if (S == "sha1" || S == "tree")

Modified: lld/trunk/test/ELF/build-id.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/build-id.s?rev=324502&r1=324501&r2=324502&view=diff
==============================================================================
--- lld/trunk/test/ELF/build-id.s (original)
+++ lld/trunk/test/ELF/build-id.s Wed Feb  7 11:22:42 2018
@@ -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
 




More information about the llvm-commits mailing list