summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/docs/CommandGuide
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
committerpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
commitbd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch)
tree309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/docs/CommandGuide
parentkillp -a should not kill the window if only one pane. (diff)
downloadwireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz
wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/docs/CommandGuide')
-rw-r--r--gnu/llvm/docs/CommandGuide/FileCheck.rst42
-rw-r--r--gnu/llvm/docs/CommandGuide/bugpoint.rst17
-rw-r--r--gnu/llvm/docs/CommandGuide/lit.rst29
-rw-r--r--gnu/llvm/docs/CommandGuide/llvm-cov.rst20
-rw-r--r--gnu/llvm/docs/CommandGuide/llvm-nm.rst9
-rw-r--r--gnu/llvm/docs/CommandGuide/llvm-profdata.rst24
-rw-r--r--gnu/llvm/docs/CommandGuide/llvm-readobj.rst4
-rw-r--r--gnu/llvm/docs/CommandGuide/opt.rst12
8 files changed, 140 insertions, 17 deletions
diff --git a/gnu/llvm/docs/CommandGuide/FileCheck.rst b/gnu/llvm/docs/CommandGuide/FileCheck.rst
index 03c88297677..413b6f41b0c 100644
--- a/gnu/llvm/docs/CommandGuide/FileCheck.rst
+++ b/gnu/llvm/docs/CommandGuide/FileCheck.rst
@@ -38,10 +38,27 @@ OPTIONS
prefixes to match. Multiple prefixes are useful for tests which might
change for different run options, but most lines remain the same.
+.. option:: --check-prefixes prefix1,prefix2,...
+
+ An alias of :option:`--check-prefix` that allows multiple prefixes to be
+ specified as a comma separated list.
+
.. option:: --input-file filename
File to check (defaults to stdin).
+.. option:: --match-full-lines
+
+ By default, FileCheck allows matches of anywhere on a line. This
+ option will require all positive matches to cover an entire
+ line. Leading and trailing whitespace is ignored, unless
+ :option:`--strict-whitespace` is also specified. (Note: negative
+ matches from ``CHECK-NOT`` are not affected by this option!)
+
+ Passing this option is equivalent to inserting ``{{^ *}}`` or
+ ``{{^}}`` before, and ``{{ *$}}`` or ``{{$}}`` after every positive
+ check pattern.
+
.. option:: --strict-whitespace
By default, FileCheck canonicalizes input horizontal whitespace (spaces and
@@ -127,7 +144,7 @@ exists anywhere in the file.
The FileCheck -check-prefix option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The FileCheck :option:`-check-prefix` option allows multiple test
+The FileCheck `-check-prefix` option allows multiple test
configurations to be driven from one `.ll` file. This is useful in many
circumstances, for example, testing different architectural variants with
:program:`llc`. Here's a simple example:
@@ -286,7 +303,7 @@ be aware that the definition rule can match `after` its use.
So, for instance, the code below will pass:
-.. code-block:: llvm
+.. code-block:: text
; CHECK-DAG: vmov.32 [[REG2:d[0-9]+]][0]
; CHECK-DAG: vmov.32 [[REG2]][1]
@@ -295,7 +312,7 @@ So, for instance, the code below will pass:
While this other code, will not:
-.. code-block:: llvm
+.. code-block:: text
; CHECK-DAG: vmov.32 [[REG2:d[0-9]+]][0]
; CHECK-DAG: vmov.32 [[REG2]][1]
@@ -444,3 +461,22 @@ relative line number references, for example:
// CHECK-NEXT: {{^ ;}}
int a
+Matching Newline Characters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To match newline characters in regular expressions the character class
+``[[:space:]]`` can be used. For example, the following pattern:
+
+.. code-block:: c++
+
+ // CHECK: DW_AT_location [DW_FORM_sec_offset] ([[DLOC:0x[0-9a-f]+]]){{[[:space:]].*}}"intd"
+
+matches output of the form (from llvm-dwarfdump):
+
+.. code-block:: text
+
+ DW_AT_location [DW_FORM_sec_offset] (0x00000233)
+ DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c9] = "intd")
+
+letting us set the :program:`FileCheck` variable ``DLOC`` to the desired value
+``0x00000233``, extracted from the line immediately preceding "``intd``".
diff --git a/gnu/llvm/docs/CommandGuide/bugpoint.rst b/gnu/llvm/docs/CommandGuide/bugpoint.rst
index f11585d359c..8c2a0d12498 100644
--- a/gnu/llvm/docs/CommandGuide/bugpoint.rst
+++ b/gnu/llvm/docs/CommandGuide/bugpoint.rst
@@ -15,7 +15,7 @@ can be used to debug three types of failures: optimizer crashes, miscompilations
by optimizers, or bad native code generation (including problems in the static
and JIT compilers). It aims to reduce large test cases to small, useful ones.
For more information on the design and inner workings of **bugpoint**, as well as
-advice for using bugpoint, see *llvm/docs/Bugpoint.html* in the LLVM
+advice for using bugpoint, see :doc:`/Bugpoint` in the LLVM
distribution.
OPTIONS
@@ -151,7 +151,12 @@ OPTIONS
**--compile-command** *command*
This option defines the command to use with the **--compile-custom**
- option to compile the bitcode testcase. This can be useful for
+ option to compile the bitcode testcase. The command should exit with a
+ failure exit code if the file is "interesting" and should exit with a
+ success exit code (i.e. 0) otherwise (this is the same as if it crashed on
+ "interesting" inputs).
+
+ This can be useful for
testing compiler output without running any link or execute stages. To
generate a reduced unit test, you may add CHECK directives to the
testcase and pass the name of an executable compile-command script in this form:
@@ -171,6 +176,14 @@ OPTIONS
**--safe-{int,jit,llc,custom}**
option.
+**--verbose-errors**\ =\ *{true,false}*
+
+ The default behavior of bugpoint is to print "<crash>" when it finds a reduced
+ test that crashes compilation. This flag prints the output of the crashing
+ program to stderr. This is useful to make sure it is the same error being
+ tracked down and not a different error that happens to crash the compiler as
+ well. Defaults to false.
+
EXIT STATUS
-----------
diff --git a/gnu/llvm/docs/CommandGuide/lit.rst b/gnu/llvm/docs/CommandGuide/lit.rst
index 0ec14bb2236..b2da58ec02c 100644
--- a/gnu/llvm/docs/CommandGuide/lit.rst
+++ b/gnu/llvm/docs/CommandGuide/lit.rst
@@ -355,6 +355,35 @@ be used to define subdirectories of optional tests, or to change other
configuration parameters --- for example, to change the test format, or the
suffixes which identify test files.
+PRE-DEFINED SUBSTITUTIONS
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+:program:`lit` provides various patterns that can be used with the RUN command.
+These are defined in TestRunner.py.
+
+ ========== ==============
+ Macro Substitution
+ ========== ==============
+ %s source path (path to the file currently being run)
+ %S source dir (directory of the file currently being run)
+ %p same as %S
+ %{pathsep} path separator
+ %t temporary file name unique to the test
+ %T temporary directory unique to the test
+ %% %
+ %/s same as %s but replace all / with \\
+ %/S same as %S but replace all / with \\
+ %/p same as %p but replace all / with \\
+ %/t same as %t but replace all / with \\
+ %/T same as %T but replace all / with \\
+ ========== ==============
+
+Further substitution patterns might be defined by each test module.
+See the modules :ref:`local-configuration-files`.
+
+More information on the testing infrastucture can be found in the
+:doc:`../TestingGuide`.
+
TEST RUN OUTPUT FORMAT
~~~~~~~~~~~~~~~~~~~~~~
diff --git a/gnu/llvm/docs/CommandGuide/llvm-cov.rst b/gnu/llvm/docs/CommandGuide/llvm-cov.rst
index d0e78a9a1d1..946b125a452 100644
--- a/gnu/llvm/docs/CommandGuide/llvm-cov.rst
+++ b/gnu/llvm/docs/CommandGuide/llvm-cov.rst
@@ -236,6 +236,26 @@ OPTIONS
Show code coverage only for functions that match the given regular expression.
+.. option:: -format=<FORMAT>
+
+ Use the specified output format. The supported formats are: "text", "html".
+
+.. option:: -output-dir=PATH
+
+ Specify a directory to write coverage reports into. If the directory does not
+ exist, it is created. When used in function view mode (i.e when -name or
+ -name-regex are used to select specific functions), the report is written to
+ PATH/functions.EXTENSION. When used in file view mode, a report for each file
+ is written to PATH/REL_PATH_TO_FILE.EXTENSION.
+
+.. option:: -Xdemangler=<TOOL>|<TOOL-OPTION>
+
+ Specify a symbol demangler. This can be used to make reports more
+ human-readable. This option can be specified multiple times to supply
+ arguments to the demangler (e.g `-Xdemangler c++filt -Xdemangler -n` for C++).
+ The demangler is expected to read a newline-separated list of symbols from
+ stdin and write a newline-separated list of the same length to stdout.
+
.. option:: -line-coverage-gt=<N>
Show code coverage only for functions with line coverage greater than the
diff --git a/gnu/llvm/docs/CommandGuide/llvm-nm.rst b/gnu/llvm/docs/CommandGuide/llvm-nm.rst
index 83d9fbaf9e8..319e6e6aecf 100644
--- a/gnu/llvm/docs/CommandGuide/llvm-nm.rst
+++ b/gnu/llvm/docs/CommandGuide/llvm-nm.rst
@@ -68,11 +68,11 @@ OPTIONS
.. option:: -B (default)
- Use BSD output format. Alias for :option:`--format=bsd`.
+ Use BSD output format. Alias for `--format=bsd`.
.. option:: -P
- Use POSIX.2 output format. Alias for :option:`--format=posix`.
+ Use POSIX.2 output format. Alias for `--format=posix`.
.. option:: --debug-syms, -a
@@ -126,6 +126,11 @@ OPTIONS
Print only symbols referenced but not defined in this file.
+.. option:: --radix=RADIX, -t
+
+ Specify the radix of the symbol address(es). Values accepted d(decimal),
+ x(hexadecomal) and o(octal).
+
BUGS
----
diff --git a/gnu/llvm/docs/CommandGuide/llvm-profdata.rst b/gnu/llvm/docs/CommandGuide/llvm-profdata.rst
index 74fe4ee9d21..f5508b5b2b8 100644
--- a/gnu/llvm/docs/CommandGuide/llvm-profdata.rst
+++ b/gnu/llvm/docs/CommandGuide/llvm-profdata.rst
@@ -44,6 +44,9 @@ interpreted as relatively more important than a shorter run. Depending on the
nature of the training runs it may be useful to adjust the weight given to each
input file by using the ``-weighted-input`` option.
+Profiles passed in via ``-weighted-input``, ``-input-files``, or via positional
+arguments are processed once for each time they are seen.
+
OPTIONS
^^^^^^^
@@ -59,10 +62,17 @@ OPTIONS
.. option:: -weighted-input=weight,filename
- Specify an input file name along with a weight. The profile counts of the input
- file will be scaled (multiplied) by the supplied ``weight``, where where ``weight``
- is a decimal integer >= 1. Input files specified without using this option are
- assigned a default weight of 1. Examples are shown below.
+ Specify an input file name along with a weight. The profile counts of the
+ supplied ``filename`` will be scaled (multiplied) by the supplied
+ ``weight``, where where ``weight`` is a decimal integer >= 1.
+ Input files specified without using this option are assigned a default
+ weight of 1. Examples are shown below.
+
+.. option:: -input-files=path, -f=path
+
+ Specify a file which contains a list of files to merge. The entries in this
+ file are newline-separated. Lines starting with '#' are skipped. Entries may
+ be of the form <filename> or <weight>,<filename>.
.. option:: -instr (default)
@@ -90,6 +100,12 @@ OPTIONS
Emit the profile using GCC's gcov format (Not yet supported).
+.. option:: -sparse[=true|false]
+
+ Do not emit function records with 0 execution count. Can only be used in
+ conjunction with -instr. Defaults to false, since it can inhibit compiler
+ optimization during PGO.
+
EXAMPLES
^^^^^^^^
Basic Usage
diff --git a/gnu/llvm/docs/CommandGuide/llvm-readobj.rst b/gnu/llvm/docs/CommandGuide/llvm-readobj.rst
index b1918b548f8..417fcd05c8a 100644
--- a/gnu/llvm/docs/CommandGuide/llvm-readobj.rst
+++ b/gnu/llvm/docs/CommandGuide/llvm-readobj.rst
@@ -80,6 +80,10 @@ input. Otherwise, it will read from the specified ``filenames``.
Display the ELF program headers (only for ELF object files).
+.. option:: -elf-section-groups, -g
+
+ Display section groups (only for ELF object files).
+
EXIT STATUS
-----------
diff --git a/gnu/llvm/docs/CommandGuide/opt.rst b/gnu/llvm/docs/CommandGuide/opt.rst
index 3a050f7d815..7b9255d2642 100644
--- a/gnu/llvm/docs/CommandGuide/opt.rst
+++ b/gnu/llvm/docs/CommandGuide/opt.rst
@@ -12,16 +12,16 @@ DESCRIPTION
The :program:`opt` command is the modular LLVM optimizer and analyzer. It
takes LLVM source files as input, runs the specified optimizations or analyses
on it, and then outputs the optimized file or the analysis results. The
-function of :program:`opt` depends on whether the :option:`-analyze` option is
+function of :program:`opt` depends on whether the `-analyze` option is
given.
-When :option:`-analyze` is specified, :program:`opt` performs various analyses
+When `-analyze` is specified, :program:`opt` performs various analyses
of the input source. It will usually print the results on standard output, but
in a few cases, it will print output to standard error or generate a file with
the analysis output, which is usually done when the output is meant for another
program.
-While :option:`-analyze` is *not* given, :program:`opt` attempts to produce an
+While `-analyze` is *not* given, :program:`opt` attempts to produce an
optimized output file. The optimizations available via :program:`opt` depend
upon what libraries were linked into it as well as any additional libraries
that have been loaded with the :option:`-load` option. Use the :option:`-help`
@@ -68,19 +68,19 @@ OPTIONS
.. option:: -disable-opt
- This option is only meaningful when :option:`-std-link-opts` is given. It
+ This option is only meaningful when `-std-link-opts` is given. It
disables most passes.
.. option:: -strip-debug
This option causes opt to strip debug information from the module before
- applying other optimizations. It is essentially the same as :option:`-strip`
+ applying other optimizations. It is essentially the same as `-strip`
but it ensures that stripping of debug information is done first.
.. option:: -verify-each
This option causes opt to add a verify pass after every pass otherwise
- specified on the command line (including :option:`-verify`). This is useful
+ specified on the command line (including `-verify`). This is useful
for cases where it is suspected that a pass is creating an invalid module but
it is not clear which pass is doing it.