Sphinx allows for definitions of command-line options using
`.. option <name>` and references to those options via `:option:<name>`.
However, it looks like there is no scoping of these options by default,
meaning that links can end up pointing to incorrect documents. See for
example the llvm-mca document, which contains references to -o that,
prior to this patch, pointed to a different document. What's worse is
that these links appear to be non-deterministic in which one is picked
(on my machine, some references end up pointing to opt, whereas on the
live docs, they point to llvm-dwarfdump, for example).
The fix is to add the .. program <name> tag. This essentially namespaces
the options (definitions and references) to the named program, ensuring
that the links are kept correct.
Reviwed by: andreadb
Differential Revision: https://reviews.llvm.org/D63873
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364538
91177308-0d34-0410-b5e6-
96231b3b80d8
FileCheck - Flexible pattern matching file verifier
===================================================
+.. program:: FileCheck
+
SYNOPSIS
--------
bugpoint - automatic test case reduction tool
=============================================
+.. program:: bugpoint
+
SYNOPSIS
--------
dsymutil - manipulate archived DWARF debug symbol files
=======================================================
+.. program:: dsymutil
+
SYNOPSIS
--------
lit - LLVM Integrated Tester
============================
+.. program:: lit
+
SYNOPSIS
--------
llc - LLVM static compiler
==========================
+.. program:: llc
+
SYNOPSIS
--------
Print a summary of command line options.
+.. option:: -o <filename>
+
+ Use ``<filename>`` as the output filename. See the summary above for more
+ details.
+
.. option:: -O=uint
Generate code at different optimization levels. These correspond to the
lli - directly execute programs from LLVM bitcode
=================================================
+.. program:: lli
+
SYNOPSIS
--------
llvm-ar - LLVM archiver
=======================
+.. program:: llvm-ar
SYNOPSIS
--------
llvm-as - LLVM assembler
========================
+.. program:: llvm-as
+
SYNOPSIS
--------
llvm-bcanalyzer - LLVM bitcode analyzer
=======================================
+.. program:: llvm-bcanalyzer
+
SYNOPSIS
--------
llvm-build - LLVM Project Build Utility
=======================================
+.. program:: llvm-build
SYNOPSIS
--------
llvm-config - Print LLVM compilation options
============================================
+.. program:: llvm-config
SYNOPSIS
--------
llvm-cov - emit coverage information
====================================
+.. program:: llvm-cov
+
SYNOPSIS
--------
llvm-cxxfilt - LLVM symbol name demangler
=========================================
+.. program:: llvm-cxxfilt
+
SYNOPSIS
--------
llvm-cxxmap - Mangled name remapping tool
=========================================
+.. program:: llvm-cxxmap
+
SYNOPSIS
--------
llvm-diff - LLVM structural 'diff'
==================================
+.. program:: llvm-diff
SYNOPSIS
--------
llvm-dis - LLVM disassembler
============================
+.. program:: llvm-dis
SYNOPSIS
--------
llvm-dwarfdump - dump and verify DWARF debug information
========================================================
+.. program:: llvm-dwarfdump
+
SYNOPSIS
--------
llvm-exegesis - LLVM Machine Instruction Benchmark
==================================================
+.. program:: llvm-exegesis
+
SYNOPSIS
--------
llvm-extract - extract a function from an LLVM module
=====================================================
+.. program:: llvm-extract
+
SYNOPSIS
--------
llvm-lib - LLVM lib.exe compatible library tool
===============================================
+.. program:: llvm-lib
SYNOPSIS
--------
llvm-link - LLVM bitcode linker
===============================
+.. program:: llvm-link
+
SYNOPSIS
--------
llvm-lipo - LLVM tool for manipulating universal binaries
=========================================================
+.. program:: llvm-lipo
+
SYNOPSIS
--------
llvm-mca - LLVM Machine Code Analyzer
=====================================
+.. program:: llvm-mca
+
SYNOPSIS
--------
Print a summary of command line options.
+.. option:: -o <filename>
+
+ Use ``<filename>`` as the output filename. See the summary above for more
+ details.
+
.. option:: -mtriple=<target triple>
Specify a target triple string.
llvm-nm - list LLVM bitcode and object file's symbol table
==========================================================
+.. program:: llvm-nm
+
SYNOPSIS
--------
llvm-objdump - LLVM's object file dumper
========================================
+.. program:: llvm-objdump
+
SYNOPSIS
--------
llvm-pdbutil - PDB File forensics and diagnostics
=================================================
+.. program:: llvm-pdbutil
+
.. contents::
:local:
llvm-profdata - Profile data tool
=================================
+.. program:: llvm-profdata
+
SYNOPSIS
--------
llvm-readobj - LLVM Object Reader
=================================
+.. program:: llvm-readobj
+
SYNOPSIS
--------
llvm-stress - generate random .ll files
=======================================
+.. program:: llvm-stress
+
SYNOPSIS
--------
llvm-symbolizer - convert addresses into source code locations
==============================================================
+.. program:: llvm-symbolizer
+
SYNOPSIS
--------
opt - LLVM optimizer
====================
+.. program:: opt
+
SYNOPSIS
--------
tblgen - Target Description To C++ Code Generator
=================================================
+.. program:: tblgen
+
SYNOPSIS
--------
Writing an LLVM Pass
====================
+.. program:: opt
+
.. contents::
:local:
you would go ahead and make it do the cool transformations you want. Once you
get it all working and tested, it may become useful to find out how fast your
pass is. The :ref:`PassManager <writing-an-llvm-pass-passmanager>` provides a
-nice command line option (:option:`--time-passes`) that allows you to get
+nice command line option (:option:`-time-passes`) that allows you to get
information about the execution time of your pass along with the other passes
you queue up. For example: