summaryrefslogtreecommitdiffstats
path: root/docs/CommandGuide
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
committerdim <dim@FreeBSD.org>2014-11-24 09:08:18 +0000
commite27feadae0885aa074df58ebfda2e7a7f7a7d590 (patch)
treef5944309621cee4fe0976be6f9ac619b7ebfc4c2 /docs/CommandGuide
parent87ba4fbed530c9d0dff7505d121035f5ed09c9f3 (diff)
downloadFreeBSD-src-e27feadae0885aa074df58ebfda2e7a7f7a7d590.zip
FreeBSD-src-e27feadae0885aa074df58ebfda2e7a7f7a7d590.tar.gz
Vendor import of llvm RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_350/final@216957
Diffstat (limited to 'docs/CommandGuide')
-rw-r--r--docs/CommandGuide/FileCheck.rst11
-rw-r--r--docs/CommandGuide/bugpoint.rst4
-rw-r--r--docs/CommandGuide/index.rst3
-rw-r--r--docs/CommandGuide/llc.rst7
-rw-r--r--docs/CommandGuide/lli.rst6
-rw-r--r--docs/CommandGuide/llvm-cov.rst114
-rw-r--r--docs/CommandGuide/llvm-dwarfdump.rst30
-rw-r--r--docs/CommandGuide/llvm-prof.rst63
-rw-r--r--docs/CommandGuide/llvm-profdata.rst102
-rw-r--r--docs/CommandGuide/llvm-symbolizer.rst23
-rw-r--r--docs/CommandGuide/opt.rst9
-rw-r--r--docs/CommandGuide/tblgen.rst3
12 files changed, 271 insertions, 104 deletions
diff --git a/docs/CommandGuide/FileCheck.rst b/docs/CommandGuide/FileCheck.rst
index 5a60d60..af01503 100644
--- a/docs/CommandGuide/FileCheck.rst
+++ b/docs/CommandGuide/FileCheck.rst
@@ -49,6 +49,17 @@ OPTIONS
The :option:`--strict-whitespace` argument disables this behavior. End-of-line
sequences are canonicalized to UNIX-style ``\n`` in all modes.
+.. option:: --implicit-check-not check-pattern
+
+ Adds implicit negative checks for the specified patterns between positive
+ checks. The option allows writing stricter tests without stuffing them with
+ ``CHECK-NOT``\ s.
+
+ For example, "``--implicit-check-not warning:``" can be useful when testing
+ diagnostic messages from tools that don't have an option similar to ``clang
+ -verify``. With this option FileCheck will verify that input does not contain
+ warnings not covered by any ``CHECK:`` patterns.
+
.. option:: -version
Show the version number of this program.
diff --git a/docs/CommandGuide/bugpoint.rst b/docs/CommandGuide/bugpoint.rst
index e4663e5..f11585d 100644
--- a/docs/CommandGuide/bugpoint.rst
+++ b/docs/CommandGuide/bugpoint.rst
@@ -124,10 +124,6 @@ OPTIONS
do not use this option, **bugpoint** will attempt to generate a reference output
by compiling the program with the "safe" backend and running it.
-**--profile-info-file** *filename*
-
- Profile file loaded by **--profile-loader**.
-
**--run-{int,jit,llc,custom}**
Whenever the test program is compiled, **bugpoint** should generate code for it
diff --git a/docs/CommandGuide/index.rst b/docs/CommandGuide/index.rst
index d50542d..ed18cd0 100644
--- a/docs/CommandGuide/index.rst
+++ b/docs/CommandGuide/index.rst
@@ -22,12 +22,13 @@ Basic Commands
llvm-link
llvm-ar
llvm-nm
- llvm-prof
llvm-config
llvm-diff
llvm-cov
+ llvm-profdata
llvm-stress
llvm-symbolizer
+ llvm-dwarfdump
Debugging Tools
~~~~~~~~~~~~~~~
diff --git a/docs/CommandGuide/llc.rst b/docs/CommandGuide/llc.rst
index 02ad798..8d5c9ce 100644
--- a/docs/CommandGuide/llc.rst
+++ b/docs/CommandGuide/llc.rst
@@ -45,7 +45,7 @@ End-user Options
Generate code at different optimization levels. These correspond to the
``-O0``, ``-O1``, ``-O2``, and ``-O3`` optimization levels used by
- :program:`llvm-gcc` and :program:`clang`.
+ :program:`clang`.
.. option:: -mtriple=<target triple>
@@ -112,11 +112,6 @@ End-user Options
optimizations allow the code generator to make use of some instructions which
would otherwise not be usable (such as ``fsin`` on X86).
-.. option:: --enable-correct-eh-support
-
- Instruct the **lowerinvoke** pass to insert code for correct exception
- handling support. This is expensive and is by default omitted for efficiency.
-
.. option:: --stats
Print statistics recorded by code-generation passes.
diff --git a/docs/CommandGuide/lli.rst b/docs/CommandGuide/lli.rst
index a9aaf31..502fbd6 100644
--- a/docs/CommandGuide/lli.rst
+++ b/docs/CommandGuide/lli.rst
@@ -190,12 +190,6 @@ CODE GENERATION OPTIONS
-**-enable-correct-eh-support**
-
- Make the -lowerinvoke pass insert expensive, but correct, EH code.
-
-
-
**-jit-enable-eh**
Exception handling should be enabled in the just-in-time compiler.
diff --git a/docs/CommandGuide/llvm-cov.rst b/docs/CommandGuide/llvm-cov.rst
index 524f240..e0b2fe9 100644
--- a/docs/CommandGuide/llvm-cov.rst
+++ b/docs/CommandGuide/llvm-cov.rst
@@ -4,32 +4,120 @@ llvm-cov - emit coverage information
SYNOPSIS
--------
-:program:`llvm-cov` [-gcno=filename] [-gcda=filename] [dump]
+:program:`llvm-cov` [options] SOURCEFILE
DESCRIPTION
-----------
-The experimental :program:`llvm-cov` tool reads in description file generated
-by compiler and coverage data file generated by instrumented program. This
-program assumes that the description and data file uses same format as gcov
-files.
+The :program:`llvm-cov` tool reads code coverage data files and displays the
+coverage information for a specified source file. It is compatible with the
+``gcov`` tool from version 4.2 of ``GCC`` and may also be compatible with
+some later versions of ``gcov``.
+
+To use llvm-cov, you must first build an instrumented version of your
+application that collects coverage data as it runs. Compile with the
+``-fprofile-arcs`` and ``-ftest-coverage`` options to add the
+instrumentation. (Alternatively, you can use the ``--coverage`` option, which
+includes both of those other options.) You should compile with debugging
+information (``-g``) and without optimization (``-O0``); otherwise, the
+coverage data cannot be accurately mapped back to the source code.
+
+At the time you compile the instrumented code, a ``.gcno`` data file will be
+generated for each object file. These ``.gcno`` files contain half of the
+coverage data. The other half of the data comes from ``.gcda`` files that are
+generated when you run the instrumented program, with a separate ``.gcda``
+file for each object file. Each time you run the program, the execution counts
+are summed into any existing ``.gcda`` files, so be sure to remove any old
+files if you do not want their contents to be included.
+
+By default, the ``.gcda`` files are written into the same directory as the
+object files, but you can override that by setting the ``GCOV_PREFIX`` and
+``GCOV_PREFIX_STRIP`` environment variables. The ``GCOV_PREFIX_STRIP``
+variable specifies a number of directory components to be removed from the
+start of the absolute path to the object file directory. After stripping those
+directories, the prefix from the ``GCOV_PREFIX`` variable is added. These
+environment variables allow you to run the instrumented program on a machine
+where the original object file directories are not accessible, but you will
+then need to copy the ``.gcda`` files back to the object file directories
+where llvm-cov expects to find them.
+
+Once you have generated the coverage data files, run llvm-cov for each main
+source file where you want to examine the coverage results. This should be run
+from the same directory where you previously ran the compiler. The results for
+the specified source file are written to a file named by appending a ``.gcov``
+suffix. A separate output file is also created for each file included by the
+main source file, also with a ``.gcov`` suffix added.
+
+The basic content of an llvm-cov output file is a copy of the source file with
+an execution count and line number prepended to every line. The execution
+count is shown as ``-`` if a line does not contain any executable code. If
+a line contains code but that code was never executed, the count is displayed
+as ``#####``.
+
OPTIONS
-------
-.. option:: -gcno=filename
+.. option:: -a, --all-blocks
+
+ Display all basic blocks. If there are multiple blocks for a single line of
+ source code, this option causes llvm-cov to show the count for each block
+ instead of just one count for the entire line.
+
+.. option:: -b, --branch-probabilities
+
+ Display conditional branch probabilities and a summary of branch information.
+
+.. option:: -c, --branch-counts
+
+ Display branch counts instead of probabilities (requires -b).
+
+.. option:: -f, --function-summaries
+
+ Show a summary of coverage for each function instead of just one summary for
+ an entire source file.
+
+.. option:: --help
+
+ Display available options (--help-hidden for more).
+
+.. option:: -l, --long-file-names
+
+ For coverage output of files included from the main source file, add the
+ main file name followed by ``##`` as a prefix to the output file names. This
+ can be combined with the --preserve-paths option to use complete paths for
+ both the main file and the included file.
+
+.. option:: -n, --no-output
+
+ Do not output any ``.gcov`` files. Summary information is still
+ displayed.
+
+.. option:: -o=<DIR|FILE>, --object-directory=<DIR>, --object-file=<FILE>
+
+ Find objects in DIR or based on FILE's path. If you specify a particular
+ object file, the coverage data files are expected to have the same base name
+ with ``.gcno`` and ``.gcda`` extensions. If you specify a directory, the
+ files are expected in that directory with the same base name as the source
+ file.
+
+.. option:: -p, --preserve-paths
- This option selects input description file generated by compiler while
- instrumenting program.
+ Preserve path components when naming the coverage output files. In addition
+ to the source file name, include the directories from the path to that
+ file. The directories are separate by ``#`` characters, with ``.`` directories
+ removed and ``..`` directories replaced by ``^`` characters. When used with
+ the --long-file-names option, this applies to both the main file name and the
+ included file name.
-.. option:: -gcda=filename
+.. option:: -u, --unconditional-branches
- This option selects coverage data file generated by instrumented compiler.
+ Include unconditional branches in the output for the --branch-probabilities
+ option.
-.. option:: -dump
+.. option:: -version
- This options enables output dump that is suitable for a developer to help
- debug :program:`llvm-cov` itself.
+ Display the version of llvm-cov.
EXIT STATUS
-----------
diff --git a/docs/CommandGuide/llvm-dwarfdump.rst b/docs/CommandGuide/llvm-dwarfdump.rst
new file mode 100644
index 0000000..afaa0be
--- /dev/null
+++ b/docs/CommandGuide/llvm-dwarfdump.rst
@@ -0,0 +1,30 @@
+llvm-dwarfdump - print contents of DWARF sections
+=================================================
+
+SYNOPSIS
+--------
+
+:program:`llvm-dwarfdump` [*options*] [*filenames...*]
+
+DESCRIPTION
+-----------
+
+:program:`llvm-dwarfdump` parses DWARF sections in the object files
+and prints their contents in human-readable form.
+
+OPTIONS
+-------
+
+.. option:: -debug-dump=section
+
+ Specify the DWARF section to dump.
+ For example, use ``abbrev`` to dump the contents of ``.debug_abbrev`` section,
+ ``loc.dwo`` to dump the contents of ``.debug_loc.dwo`` etc.
+ See ``llvm-dwarfdump --help`` for the complete list of supported sections.
+ Use ``all`` to dump all DWARF sections. It is the default.
+
+EXIT STATUS
+-----------
+
+:program:`llvm-dwarfdump` returns 0. Other exit codes imply internal
+program error.
diff --git a/docs/CommandGuide/llvm-prof.rst b/docs/CommandGuide/llvm-prof.rst
deleted file mode 100644
index e8d0b19..0000000
--- a/docs/CommandGuide/llvm-prof.rst
+++ /dev/null
@@ -1,63 +0,0 @@
-llvm-prof - print execution profile of LLVM program
-===================================================
-
-
-SYNOPSIS
---------
-
-
-**llvm-prof** [*options*] [*bitcode file*] [*llvmprof.out*]
-
-
-DESCRIPTION
------------
-
-
-The **llvm-prof** tool reads in an *llvmprof.out* file (which can
-optionally use a specific file with the third program argument), a bitcode file
-for the program, and produces a human readable report, suitable for determining
-where the program hotspots are.
-
-This program is often used in conjunction with the *utils/profile.pl*
-script. This script automatically instruments a program, runs it with the JIT,
-then runs **llvm-prof** to format a report. To get more information about
-*utils/profile.pl*, execute it with the **-help** option.
-
-
-OPTIONS
--------
-
-
-
-**--annotated-llvm** or **-A**
-
- In addition to the normal report printed, print out the code for the
- program, annotated with execution frequency information. This can be
- particularly useful when trying to visualize how frequently basic blocks
- are executed. This is most useful with basic block profiling
- information or better.
-
-
-
-**--print-all-code**
-
- Using this option enables the **--annotated-llvm** option, but it
- prints the entire module, instead of just the most commonly executed
- functions.
-
-
-
-**--time-passes**
-
- Record the amount of time needed for each pass and print it to standard
- error.
-
-
-
-
-EXIT STATUS
------------
-
-
-**llvm-prof** returns 1 if it cannot load the bitcode file or the profile
-information. Otherwise, it exits with zero.
diff --git a/docs/CommandGuide/llvm-profdata.rst b/docs/CommandGuide/llvm-profdata.rst
new file mode 100644
index 0000000..0762e2c
--- /dev/null
+++ b/docs/CommandGuide/llvm-profdata.rst
@@ -0,0 +1,102 @@
+llvm-profdata - Profile data tool
+=================================
+
+SYNOPSIS
+--------
+
+:program:`llvm-profdata` *command* [*args...*]
+
+DESCRIPTION
+-----------
+
+The :program:`llvm-profdata` tool is a small utility for working with profile
+data files.
+
+COMMANDS
+--------
+
+* `merge <profdata_merge_>`_
+* `show <profdata_show_>`_
+
+.. program:: llvm-profdata merge
+
+.. _profdata_merge:
+
+MERGE
+-----
+
+SYNOPSIS
+^^^^^^^^
+
+:program:`llvm-profdata merge` [*options*] [*filenames...*]
+
+DESCRIPTION
+^^^^^^^^^^^
+
+:program:`llvm-profdata merge` takes several profile data files
+generated by PGO instrumentation and merges them together into a single
+indexed profile data file.
+
+OPTIONS
+^^^^^^^
+
+.. option:: -help
+
+ Print a summary of command line options.
+
+.. option:: -output=output, -o=output
+
+ Specify the output file name. *Output* cannot be ``-`` as the resulting
+ indexed profile data can't be written to standard output.
+
+.. program:: llvm-profdata show
+
+.. _profdata_show:
+
+SHOW
+----
+
+SYNOPSIS
+^^^^^^^^
+
+:program:`llvm-profdata show` [*options*] [*filename*]
+
+DESCRIPTION
+^^^^^^^^^^^
+
+:program:`llvm-profdata show` takes a profile data file and displays the
+information about the profile counters for this file and
+for any of the specified function(s).
+
+If *filename* is omitted or is ``-``, then **llvm-profdata show** reads its
+input from standard input.
+
+OPTIONS
+^^^^^^^
+
+.. option:: -all-functions
+
+ Print details for every function.
+
+.. option:: -counts
+
+ Print the counter values for the displayed functions.
+
+.. option:: -function=string
+
+ Print details for a function if the function's name contains the given string.
+
+.. option:: -help
+
+ Print a summary of command line options.
+
+.. option:: -output=output, -o=output
+
+ Specify the output file name. If *output* is ``-`` or it isn't specified,
+ then the output is sent to standard output.
+
+EXIT STATUS
+-----------
+
+:program:`llvm-profdata` returns 1 if the command is omitted or is invalid,
+if it cannot read input files, or if there is a mismatch between their data.
diff --git a/docs/CommandGuide/llvm-symbolizer.rst b/docs/CommandGuide/llvm-symbolizer.rst
index e03be9b..ce2d9c0 100644
--- a/docs/CommandGuide/llvm-symbolizer.rst
+++ b/docs/CommandGuide/llvm-symbolizer.rst
@@ -10,7 +10,9 @@ DESCRIPTION
-----------
:program:`llvm-symbolizer` reads object file names and addresses from standard
-input and prints corresponding source code locations to standard output. This
+input and prints corresponding source code locations to standard output.
+If object file is specified in command line, :program:`llvm-symbolizer` reads
+only addresses from standard input. This
program uses debug info sections and symbol table in the object files.
EXAMPLE
@@ -45,13 +47,28 @@ EXAMPLE
_main
/tmp/source_x86_64.cc:8
+ $ cat addr2.txt
+ 0x4004f4
+ 0x401000
+ $ llvm-symbolizer -obj=a.out < addr2.txt
+ main
+ /tmp/a.cc:4
+
+ foo(int)
+ /tmp/a.cc:12
OPTIONS
-------
-.. option:: -functions
+.. option:: -obj
+
+ Path to object file to be symbolized.
+
+.. option:: -functions=[none|short|linkage]
- Print function names as well as source file/line locations. Defaults to true.
+ Specify the way function names are printed (omit function name,
+ print short function name, or print full linkage name, respectively).
+ Defaults to ``linkage``.
.. option:: -use-symbol-table
diff --git a/docs/CommandGuide/opt.rst b/docs/CommandGuide/opt.rst
index 179c297..ad5b62c 100644
--- a/docs/CommandGuide/opt.rst
+++ b/docs/CommandGuide/opt.rst
@@ -65,9 +65,8 @@ OPTIONS
.. option:: -std-compile-opts
This is short hand for a standard list of *compile time optimization* passes.
- This is typically used to optimize the output from the llvm-gcc front end. It
- might be useful for other front end compilers as well. To discover the full
- set of options available, use the following command:
+ It might be useful for other front end compilers as well. To discover the
+ full set of options available, use the following command:
.. code-block:: sh
@@ -100,10 +99,6 @@ OPTIONS
:option:`-std-compile-opts` and :option:`-verify-each` can quickly track down
this kind of problem.
-.. option:: -profile-info-file <filename>
-
- Specify the name of the file loaded by the ``-profile-loader`` option.
-
.. option:: -stats
Print statistics.
diff --git a/docs/CommandGuide/tblgen.rst b/docs/CommandGuide/tblgen.rst
index 1c46828..a42b04d 100644
--- a/docs/CommandGuide/tblgen.rst
+++ b/docs/CommandGuide/tblgen.rst
@@ -15,7 +15,8 @@ users of LLVM will not need to use this program. It is only for assisting with
writing an LLVM target backend.
The input and output of :program:`tblgen` is beyond the scope of this short
-introduction. Please see :doc:`../TableGenFundamentals`.
+introduction; please see the :doc:`introduction to TableGen
+<../TableGen/index>`.
The *filename* argument specifies the name of a Target Description (``.td``)
file to read as input.
OpenPOWER on IntegriCloud