[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.
This commit is contained in:
Fangrui Song 2020-08-17 09:59:22 -07:00
parent 139810449b
commit 661c089a40
3 changed files with 11 additions and 11 deletions

View File

@ -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">;

View File

@ -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

View File

@ -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