[lld] 661c089 - [ELF] Enforce two-dash form for some LLD specific options and the newer --[no-]pcrel-optimize

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 10:00:38 PDT 2020


Author: Fangrui Song
Date: 2020-08-17T10:00:31-07:00
New Revision: 661c089a402e0d41a28c94fab35d85c8ef90747e

URL: https://github.com/llvm/llvm-project/commit/661c089a402e0d41a28c94fab35d85c8ef90747e
DIFF: https://github.com/llvm/llvm-project/commit/661c089a402e0d41a28c94fab35d85c8ef90747e.diff

LOG: [ELF] Enforce two-dash form for some LLD specific options and the newer --[no-]pcrel-optimize

Since -[no-]toc-optimize has not ever been used, we can enforce the two-dash form as well.

Added: 
    

Modified: 
    lld/ELF/Options.td
    lld/test/ELF/lto/thinlto-time-trace.ll
    lld/test/ELF/time-trace.s

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Options.td b/lld/ELF/Options.td
index 5563a956be561..c533113dc18f5 100644
--- a/lld/ELF/Options.td
+++ b/lld/ELF/Options.td
@@ -394,17 +394,17 @@ defm threads
          "Number of threads. '1' disables multi-threading. By default all "
          "available hardware threads are used">;
 
-def time_trace: F<"time-trace">, HelpText<"Record time trace">;
-def time_trace_file_eq: J<"time-trace-file=">, HelpText<"Specify time trace output file">;
+def time_trace: FF<"time-trace">, HelpText<"Record time trace">;
+def time_trace_file_eq: JJ<"time-trace-file=">, HelpText<"Specify time trace output file">;
 
-defm time_trace_granularity: Eq<"time-trace-granularity",
+defm time_trace_granularity: EEq<"time-trace-granularity",
   "Minimum time granularity (in microseconds) traced by time profiler">;
 
-defm toc_optimize : B<"toc-optimize",
+defm toc_optimize : BB<"toc-optimize",
     "(PowerPC64) Enable TOC related optimizations (default)",
     "(PowerPC64) Disable TOC related optimizations">;
 
-defm pcrel_optimize : B<"pcrel-optimize",
+defm pcrel_optimize : BB<"pcrel-optimize",
     "(PowerPC64) Enable PC-relative optimizations (default)",
     "(PowerPC64) Disable PC-relative optimizations">;
 
@@ -415,7 +415,7 @@ defm trace_symbol: Eq<"trace-symbol", "Trace references to symbols">;
 defm undefined: Eq<"undefined", "Force undefined symbol during linking">,
   MetaVarName<"<symbol>">;
 
-defm undefined_glob: Eq<"undefined-glob", "Force undefined symbol during linking">,
+defm undefined_glob: EEq<"undefined-glob", "Force undefined symbol during linking">,
   MetaVarName<"<pattern>">;
 
 def unique: F<"unique">, HelpText<"Creates a separate output section for every orphan input section">;

diff  --git a/lld/test/ELF/lto/thinlto-time-trace.ll b/lld/test/ELF/lto/thinlto-time-trace.ll
index 1b8335cbb9a90..2213a3051f52b 100644
--- a/lld/test/ELF/lto/thinlto-time-trace.ll
+++ b/lld/test/ELF/lto/thinlto-time-trace.ll
@@ -5,13 +5,13 @@
 ; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
 
 ; Test single-threaded
-; RUN: ld.lld --thinlto-jobs=1 -time-trace -time-trace-granularity=0 -shared %t1.o %t2.o -o %t3.so
+; RUN: ld.lld --thinlto-jobs=1 --time-trace --time-trace-granularity=0 -shared %t1.o %t2.o -o %t3.so
 ; RUN: cat %t3.so.time-trace \
 ; RUN:   | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
 ; RUN:   | FileCheck %s
 
 ; Test multi-threaded
-; RUN: ld.lld -time-trace -time-trace-granularity=0 -shared %t1.o %t2.o -o %t4.so
+; RUN: ld.lld --time-trace --time-trace-granularity=0 -shared %t1.o %t2.o -o %t4.so
 ; RUN: cat %t4.so.time-trace \
 ; RUN:   | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
 ; RUN:   | FileCheck %s

diff  --git a/lld/test/ELF/time-trace.s b/lld/test/ELF/time-trace.s
index e1da4c476f407..f7c18dff92fd6 100644
--- a/lld/test/ELF/time-trace.s
+++ b/lld/test/ELF/time-trace.s
@@ -2,19 +2,19 @@
 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
 
 # Test implicit trace file name
-# RUN: ld.lld -time-trace -time-trace-granularity=0 -o %t1.elf %t.o
+# RUN: ld.lld --time-trace --time-trace-granularity=0 -o %t1.elf %t.o
 # RUN: cat %t1.elf.time-trace \
 # RUN:   | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
 # RUN:   | FileCheck %s
 
 # Test specified trace file name
-# RUN: ld.lld -time-trace -time-trace-file=%t2.json -time-trace-granularity=0 -o %t2.elf %t.o
+# RUN: ld.lld --time-trace --time-trace-file=%t2.json --time-trace-granularity=0 -o %t2.elf %t.o
 # RUN: cat %t2.json \
 # RUN:   | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
 # RUN:   | FileCheck %s
 
 # Test trace requested to stdout
-# RUN: ld.lld -time-trace -time-trace-file=- -time-trace-granularity=0 -o %t3.elf %t.o \
+# RUN: ld.lld --time-trace --time-trace-file=- --time-trace-granularity=0 -o %t3.elf %t.o \
 # RUN:   | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
 # RUN:   | FileCheck %s
 


        


More information about the llvm-commits mailing list