From: Fangrui Song Date: Mon, 17 Aug 2020 16:59:22 +0000 (-0700) Subject: [ELF] Enforce two-dash form for some LLD specific options and the newer --[no-]pcrel... X-Git-Tag: llvmorg-13-init~14511 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=661c089a402e0d41a28c94fab35d85c8ef90747e;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/lld/ELF/Options.td b/lld/ELF/Options.td index 5563a95..c533113 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<"">; -defm undefined_glob: Eq<"undefined-glob", "Force undefined symbol during linking">, +defm undefined_glob: EEq<"undefined-glob", "Force undefined symbol during linking">, MetaVarName<"">; 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 1b8335c..2213a305 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 e1da4c4..f7c18dff 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