Regenerate ReStructuredText based manpages for llvm-project tools:

* bugpoint.1
* clang.1
* llc.1
* lldb.1
* lli.1
* llvm-ar.1
* llvm-as.1
* llvm-bcanalyzer.1
* llvm-cov.1
* llvm-diff.1
* llvm-dis.1
* llvm-dwarfdump.1
* llvm-extract.1
* llvm-link.1
* llvm-mca.1
* llvm-nm.1
* llvm-pdbutil.1
* llvm-profdata.1
* llvm-symbolizer.1
* llvm-tblgen.1
* opt.1

Add newly generated manpages for:

* llvm-addr2line.1 (this is an alias of llvm-symbolizer)
* llvm-cxxfilt.1
* llvm-objcopy.1
* llvm-ranlib.1 (this is an alias of llvm-ar)

Note that llvm-objdump.1 is an exception, as upstream has both a plain
.1 file, and a .rst variant. These will have to be reconciled upstream
first.

MFC after:	3 days
This commit is contained in:
dim 2020-06-27 11:56:49 +00:00
parent 69056dde94
commit 5b72ffe827
31 changed files with 2615 additions and 692 deletions

View File

@ -1191,6 +1191,7 @@ OLD_FILES+=usr/bin/clang
OLD_FILES+=usr/bin/clang++ OLD_FILES+=usr/bin/clang++
OLD_FILES+=usr/bin/clang-cpp OLD_FILES+=usr/bin/clang-cpp
OLD_FILES+=usr/bin/clang-tblgen OLD_FILES+=usr/bin/clang-tblgen
OLD_FILES+=usr/bin/llvm-addr2line
OLD_FILES+=usr/bin/llvm-ar OLD_FILES+=usr/bin/llvm-ar
OLD_FILES+=usr/bin/llvm-nm OLD_FILES+=usr/bin/llvm-nm
OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-objdump

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "BUGPOINT" "1" "2018-08-02" "7" "LLVM" .TH "BUGPOINT" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
bugpoint \- automatic test case reduction tool bugpoint \- automatic test case reduction tool
. .
@ -300,10 +300,10 @@ If \fBbugpoint\fP succeeds in finding a problem, it will exit with 0. Otherwise
if an error occurs, it will exit with a non\-zero value. if an error occurs, it will exit with a non\-zero value.
.SH SEE ALSO .SH SEE ALSO
.sp .sp
opt|opt \fBopt(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "CLANG" "1" "Aug 02, 2018" "7" "Clang" .TH "CLANG" "1" "2020-06-26" "10" "Clang"
.SH NAME .SH NAME
clang \- the Clang C, C++, and Objective-C compiler clang \- the Clang C, C++, and Objective-C compiler
. .
@ -89,7 +89,7 @@ an "a.out", ".dylib" or ".so" file.
.sp .sp
The Clang Static Analyzer is a tool that scans source code to try to find bugs The Clang Static Analyzer is a tool that scans source code to try to find bugs
through code analysis. This tool uses many parts of Clang and is built into through code analysis. This tool uses many parts of Clang and is built into
the same driver. Please see <\fI\%http://clang\-analyzer.llvm.org\fP> for more details the same driver. Please see <\fI\%https://clang\-analyzer.llvm.org\fP> for more details
on how to use the static analyzer. on how to use the static analyzer.
.SH OPTIONS .SH OPTIONS
.SS Stage Selection Options .SS Stage Selection Options
@ -458,8 +458,21 @@ strings and other optimizations.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-flax\-vector\-conversions .B \-flax\-vector\-conversions, \-flax\-vector\-conversions=<kind>, \-fno\-lax\-vector\-conversions
Allow loose type checking rules for implicit vector conversions. Allow loose type checking rules for implicit vector conversions.
Possible values of <kind>:
.INDENT 7.0
.IP \(bu 2
\fBnone\fP: allow no implicit conversions between vectors
.IP \(bu 2
\fBinteger\fP: allow implicit bitcasts between integer vectors of the same
overall bit\-width
.IP \(bu 2
\fBall\fP: allow implicit bitcasts between any vectors of the same
overall bit\-width
.UNINDENT
.sp
<kind> defaults to \fBinteger\fP if unspecified.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -499,7 +512,7 @@ Specify the architecture to build for.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-mmacosx\-version\-min=<version> .B \-mmacosx\-version\-min=<version>
When building for Mac OS X, specify the minimum version supported by your When building for macOS, specify the minimum version supported by your
application. application.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
@ -510,6 +523,18 @@ application.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-print\-supported\-cpus
Print out a list of supported processors for the given target (specified
through \-\-target=<architecture> or \-arch <architecture>). If no target is
specified, the system default target will be used.
.UNINDENT
.INDENT 0.0
.TP
.B \-mcpu=?, \-mtune=?
Aliases of \-\-print\-supported\-cpus
.UNINDENT
.INDENT 0.0
.TP
.B \-march=<cpu> .B \-march=<cpu>
Specify that Clang should generate code for a specific processor family Specify that Clang should generate code for a specific processor family
member and later. For example, if you specify \-march=i486, the compiler is member and later. For example, if you specify \-march=i486, the compiler is
@ -848,7 +873,7 @@ Darwin targets.
.UNINDENT .UNINDENT
.SH BUGS .SH BUGS
.sp .sp
To report bugs, please visit <\fI\%http://llvm.org/bugs/\fP>. Most bug reports should To report bugs, please visit <\fI\%https://bugs.llvm.org/\fP>. Most bug reports should
include preprocessed source files (use the \fI\%\-E\fP option) and the full include preprocessed source files (use the \fI\%\-E\fP option) and the full
output of the compiler, along with information to reproduce. output of the compiler, along with information to reproduce.
.SH SEE ALSO .SH SEE ALSO
@ -857,6 +882,6 @@ output of the compiler, along with information to reproduce.
.SH AUTHOR .SH AUTHOR
Maintained by the Clang / LLVM Team (<http://clang.llvm.org>) Maintained by the Clang / LLVM Team (<http://clang.llvm.org>)
.SH COPYRIGHT .SH COPYRIGHT
2007-2018, The Clang Team 2007-2020, The Clang Team
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLC" "1" "2018-08-02" "7" "LLVM" .TH "LLC" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llc \- LLVM static compiler llc \- LLVM static compiler
. .
@ -41,7 +41,7 @@ for a specified architecture. The assembly language output can then be passed
through a native assembler and linker to generate a native executable. through a native assembler and linker to generate a native executable.
.sp .sp
The choice of architecture for the output assembly code is automatically The choice of architecture for the output assembly code is automatically
determined from the input file, unless the \fB\-march\fP option is used to determined from the input file, unless the \fI\%\-march\fP option is used to
override the default. override the default.
.SH OPTIONS .SH OPTIONS
.sp .sp
@ -49,11 +49,11 @@ If \fBfilename\fP is "\fB\-\fP" or omitted, \fBllc\fP reads from standard input.
Otherwise, it will from \fBfilename\fP\&. Inputs can be in either the LLVM assembly Otherwise, it will from \fBfilename\fP\&. Inputs can be in either the LLVM assembly
language format (\fB\&.ll\fP) or the LLVM bitcode format (\fB\&.bc\fP). language format (\fB\&.ll\fP) or the LLVM bitcode format (\fB\&.bc\fP).
.sp .sp
If the \fB\-o\fP option is omitted, then \fBllc\fP will send its output If the \fI\%\-o\fP option is omitted, then \fBllc\fP will send its output
to standard output if the input is from standard input. If the \fB\-o\fP to standard output if the input is from standard input. If the \fI\%\-o\fP
option specifies "\fB\-\fP", then the output will also be sent to standard output. option specifies "\fB\-\fP", then the output will also be sent to standard output.
.sp .sp
If no \fB\-o\fP option is specified and an input file other than "\fB\-\fP" is If no \fI\%\-o\fP option is specified and an input file other than "\fB\-\fP" is
specified, then \fBllc\fP creates the output filename by taking the input specified, then \fBllc\fP creates the output filename by taking the input
filename, removing any existing \fB\&.bc\fP extension, and adding a \fB\&.s\fP suffix. filename, removing any existing \fB\&.bc\fP extension, and adding a \fB\&.s\fP suffix.
.sp .sp
@ -66,6 +66,12 @@ Print a summary of command line options.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-o <filename>
Use \fB<filename>\fP as the output filename. See the summary above for more
details.
.UNINDENT
.INDENT 0.0
.TP
.B \-O=uint .B \-O=uint
Generate code at different optimization levels. These correspond to the Generate code at different optimization levels. These correspond to the
\fB\-O0\fP, \fB\-O1\fP, \fB\-O2\fP, and \fB\-O3\fP optimization levels used by \fB\-O0\fP, \fB\-O1\fP, \fB\-O2\fP, and \fB\-O3\fP optimization levels used by
@ -130,8 +136,8 @@ llvm\-as < /dev/null | llc \-march=xyz \-mattr=help
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-disable\-fp\-elim .B \-\-frame\-pointer
Disable frame pointer elimination optimization. Specify effect of frame pointer elimination optimization (all,non\-leaf,none).
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -174,7 +180,7 @@ error.
.B \-\-load=<dso_path> .B \-\-load=<dso_path>
Dynamically load \fBdso_path\fP (a path to a dynamically shared object) that Dynamically load \fBdso_path\fP (a path to a dynamically shared object) that
implements an LLVM target. This will permit the target name to be used with implements an LLVM target. This will permit the target name to be used with
the \fB\-march\fP option so that code can be generated for that target. the \fI\%\-march\fP option so that code can be generated for that target.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -191,6 +197,12 @@ sizes (unsigned LEB128). The stack size values only include the space allocated
in the function prologue. Functions with dynamic stack allocations are not in the function prologue. Functions with dynamic stack allocations are not
included. included.
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B \-remarks\-section
Emit the __remarks (MachO) section which contains metadata about remark
diagnostics.
.UNINDENT
.SS Tuning/Configuration Options .SS Tuning/Configuration Options
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -265,10 +277,10 @@ If \fBllc\fP succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non\-zero value. occurs, it will exit with a non\-zero value.
.SH SEE ALSO .SH SEE ALSO
.sp .sp
lli \fBlli(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLDB" "1" "Jan 27, 2020" "8" "LLDB" .TH "LLDB" "1" "2020-06-26" "8" "LLDB"
.SH NAME .SH NAME
lldb \- LLDB Documentation lldb \- LLDB Documentation
. .
@ -61,12 +61,12 @@ Tells the debugger to attach to a process with the given pid.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-n <value> .B \-n <value>
Alias for attach\-name Alias for \-\-attach\-name
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-p <value> .B \-p <value>
Alias for attach\-pid Alias for \-\-attach\-pid
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -76,7 +76,7 @@ Tells the debugger to wait for a process with the given pid or name to launch be
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-w .B \-w
Alias for wait\-for Alias for \-\-wait\-for
.UNINDENT .UNINDENT
.SH COMMANDS .SH COMMANDS
.INDENT 0.0 .INDENT 0.0
@ -87,27 +87,27 @@ Tells the debugger to run the commands from \-s, \-S, \-o & \-O, and then quit.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-b .B \-b
Alias for batch Alias for \-\-batch
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-K <value> .B \-K <value>
Alias for source\-on\-crash Alias for \-\-source\-on\-crash
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-k <value> .B \-k <value>
Alias for one\-line\-on\-crash Alias for \-\-one\-line\-on\-crash
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-local\-lldbinit .B \-\-local\-lldbinit
Allow the debugger to parse the .lldbinit files in the current working directory, unless no\-lldbinit is passed. Allow the debugger to parse the .lldbinit files in the current working directory, unless \-\-no\-lldbinit is passed.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-no\-lldbinit .B \-\-no\-lldbinit
Do not automatically parse any .lldbinit files. Do not automatically parse any \(aq.lldbinit\(aq files.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -127,17 +127,17 @@ Tells the debugger to execute this one\-line lldb command after any file provide
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-O <value> .B \-O <value>
Alias for one\-line\-before\-file Alias for \-\-one\-line\-before\-file
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-o <value> .B \-o <value>
Alias for one\-line Alias for \-\-one\-line
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-Q .B \-Q
Alias for source\-quietly Alias for \-\-source\-quietly
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -162,17 +162,17 @@ Tells the debugger to read in and execute the lldb commands in the given file, a
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-S <value> .B \-S <value>
Alias for source\-before\-file Alias for \-\-source\-before\-file
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-s <value> .B \-s <value>
Alias for source Alias for \-\-source
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-x .B \-x
Alias for no\-lldbinit Alias for \-\-no\-lldbinit
.UNINDENT .UNINDENT
.SH OPTIONS .SH OPTIONS
.INDENT 0.0 .INDENT 0.0
@ -183,7 +183,7 @@ Tells the debugger to use the specified architecture when starting and running t
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-a <value> .B \-a <value>
Alias for arch Alias for \-\-arch
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -203,7 +203,7 @@ Tells the debugger to use the full path to <filename> as the core file.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-c <value> .B \-c <value>
Alias for core Alias for \-\-core
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -213,17 +213,17 @@ Tells the debugger to print out extra information for debugging itself.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-d .B \-d
Alias for debug Alias for \-\-debug
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-editor .B \-\-editor
Tells the debugger to open source files using the hosts “external editor” mechanism. Tells the debugger to open source files using the host\(aqs "external editor" mechanism.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-e .B \-e
Alias for editor Alias for \-\-editor
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -233,7 +233,7 @@ Tells the debugger to use the file <filename> as the program to be debugged.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-f <value> .B \-f <value>
Alias for file Alias for \-\-file
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -243,7 +243,7 @@ Prints out the usage information for the LLDB debugger.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-h .B \-h
Alias for help Alias for \-\-help
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -263,18 +263,18 @@ Prints out the current version number of the LLDB debugger.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-v .B \-v
Alias for version Alias for \-\-version
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-X .B \-X
Alias for no\-use\-color Alias for \-\-no\-use\-color
.UNINDENT .UNINDENT
.SH REPL .SH REPL
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-r=<flags> .B \-r=<flags>
Alias for repl=<flags> Alias for \-\-repl=<flags>
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -289,13 +289,13 @@ Runs lldb in REPL mode with a stub process with the given flags.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-R <value> .B \-R <value>
Alias for repl\-language Alias for \-\-repl\-language
.UNINDENT .UNINDENT
.SH SCRIPTING .SH SCRIPTING
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-l <value> .B \-l <value>
Alias for script\-language Alias for \-\-script\-language
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -305,7 +305,7 @@ Prints out the path to the lldb.py file for this version of lldb.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-P .B \-P
Alias for python\-path Alias for \-\-python\-path
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -317,11 +317,11 @@ Tells the debugger to use the specified scripting language for user\-defined scr
The debugger can be started in several modes. The debugger can be started in several modes.
.sp .sp
Passing an executable as a positional argument prepares \fBlldb\fP to Passing an executable as a positional argument prepares \fBlldb\fP to
debug the given executable. Arguments passed after are considered arguments debug the given executable. Arguments passed after \-\- are considered arguments
to the debugged executable. to the debugged executable.
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
lldb arch x86_64 /path/to/program arch arvm7 lldb \-\-arch x86_64 /path/to/program \-\- \-\-arch arvm7
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
@ -334,14 +334,14 @@ lldb \-n <process\-name>
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
Passing repl starts \fBlldb\fP in REPL mode. Passing \-\-repl starts \fBlldb\fP in REPL mode.
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
lldb \-r lldb \-r
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
Passing core causes \fBlldb\fP to debug the core file. Passing \-\-core causes \fBlldb\fP to debug the core file.
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
lldb \-c /path/to/core lldb \-c /path/to/core
@ -353,7 +353,7 @@ run the specified commands before or after events, like loading the file or
crashing, in the order provided on the command line. crashing, in the order provided on the command line.
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
lldb \-O settings set stop\-disassembly\-count 20 \-o run \-o bt lldb \-O \(aqsettings set stop\-disassembly\-count 20\(aq \-o \(aqrun\(aq \-o \(aqbt\(aq
lldb \-S /source/before/file \-s /source/after/file lldb \-S /source/before/file \-s /source/after/file
lldb \-K /source/before/crash \-k /source/after/crash lldb \-K /source/before/crash \-k /source/after/crash
.UNINDENT .UNINDENT
@ -365,12 +365,12 @@ loading the file (via \-o or \-s) will be ignored.
.sp .sp
In \fBlldb\fP there is a help command which can be used to find In \fBlldb\fP there is a help command which can be used to find
descriptions and examples of all \fBlldb\fP commands. To get help on descriptions and examples of all \fBlldb\fP commands. To get help on
“breakpoint set” you would type “help breakpoint set”. "breakpoint set" you would type "help breakpoint set".
.sp .sp
There is also an apropos command which will search the help text of all There is also an apropos command which will search the help text of all
commands for a given term this is useful for locating a command by topic. commands for a given term this is useful for locating a command by topic.
For instance, “apropos breakpoint” will list any command that has the word For instance, "apropos breakpoint" will list any command that has the word
“breakpoint” in its help text. "breakpoint" in its help text.
.SH CONFIGURATION FILES .SH CONFIGURATION FILES
.sp .sp
\fBlldb\fP reads things like settings, aliases and commands from the \fBlldb\fP reads things like settings, aliases and commands from the

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLI" "1" "2018-08-02" "7" "LLVM" .TH "LLI" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
lli \- directly execute programs from LLVM bitcode lli \- directly execute programs from LLVM bitcode
. .
@ -162,6 +162,7 @@ Choose the code model from:
.nf .nf
.ft C .ft C
default: Target default code model default: Target default code model
tiny: Tiny code model
small: Small code model small: Small code model
kernel: Kernel code model kernel: Kernel code model
medium: Medium code model medium: Medium code model
@ -289,10 +290,10 @@ If \fBlli\fP fails to load the program, it will exit with an exit code of 1.
Otherwise, it will return the exit code of the program it executes. Otherwise, it will return the exit code of the program it executes.
.SH SEE ALSO .SH SEE ALSO
.sp .sp
\fBllc\fP \fBllc(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,6 +1,7 @@
# $FreeBSD$ # $FreeBSD$
PROG_CXX= llvm-ar PROG_CXX= llvm-ar
MAN= llvm-ar.1 llvm-ranlib.1
SRCDIR= llvm/tools/llvm-ar SRCDIR= llvm/tools/llvm-ar
SRCS+= llvm-ar.cpp SRCS+= llvm-ar.cpp

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-AR" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-AR" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-ar \- LLVM archiver llvm-ar \- LLVM archiver
. .
@ -33,358 +33,388 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.. ..
.SH SYNOPSIS .SH SYNOPSIS
.sp .sp
\fBllvm\-ar\fP [\-]{dmpqrtx}[Rabfikou] [relpos] [count] <archive> [files...] \fBllvm\-ar\fP [\-]{dmpqrstx}[abcDilLNoOPsSTuUvV] [relpos] [count] archive [files...]
.SH DESCRIPTION .SH DESCRIPTION
.sp .sp
The \fBllvm\-ar\fP command is similar to the common Unix utility, \fBar\fP\&. It The \fBllvm\-ar\fP command is similar to the common Unix utility,
archives several files together into a single file. The intent for this is \fBar\fP\&. It archives several files, such as objects and LLVM bitcode
to produce archive libraries by LLVM bitcode that can be linked into an files into a single archive library that can be linked into a program. However,
LLVM program. However, the archive can contain any kind of file. By default, the archive can contain any kind of file. By default, \fBllvm\-ar\fP
\fBllvm\-ar\fP generates a symbol table that makes linking faster because generates a symbol table that makes linking faster because only the symbol
only the symbol table needs to be consulted, not each individual file member table needs to be consulted, not each individual file member of the archive.
of the archive.
.sp .sp
The \fBllvm\-ar\fP command can be used to \fIread\fP SVR4, GNU and BSD style archive The \fBllvm\-ar\fP command can be used to \fIread\fP archive files in SVR4,
files. However, right now it can only write in the GNU format. If an GNU, BSD and Darwin format, and \fIwrite\fP in the GNU, BSD, and Darwin style
SVR4 or BSD style archive is used with the \fBr\fP (replace) or \fBq\fP (quick archive files. If an SVR4 format archive is used with the \fI\%r\fP
update) operations, the archive will be reconstructed in GNU format. (replace), \fI\%d\fP (delete), \fI\%m\fP (move) or \fI\%q\fP
(quick update) operations, the archive will be reconstructed in the format
defined by \fI\%\-\-format\fP\&.
.sp .sp
Here\(aqs where \fBllvm\-ar\fP departs from previous \fBar\fP implementations: Here\(aqs where \fBllvm\-ar\fP departs from previous \fBar\fP
implementations:
.sp
\fIThe following option is not supported\fP
.INDENT 0.0
.INDENT 3.5
[f] \- truncate inserted filenames
.UNINDENT
.UNINDENT
.sp
\fIThe following options are ignored for compatibility\fP
.INDENT 0.0
.INDENT 3.5
\-\-plugin=<string> \- load a plugin which adds support for other file formats
.sp
[l] \- ignored in \fBar\fP
.UNINDENT
.UNINDENT
.sp .sp
\fISymbol Table\fP \fISymbol Table\fP
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Since \fBllvm\-ar\fP supports bitcode files. The symbol table it creates Since \fBllvm\-ar\fP supports bitcode files, the symbol table it creates
is in GNU format and includes both native and bitcode files. includes both native and bitcode symbols.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
\fILong Paths\fP \fIDeterministic Archives\fP
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Currently \fBllvm\-ar\fP can read GNU and BSD long file names, but only writes By default, \fBllvm\-ar\fP always uses zero for timestamps and UIDs/GIDs
archives with the GNU format. to write archives in a deterministic mode. This is equivalent to the
\fI\%D\fP modifier being enabled by default. If you wish to maintain
compatibility with other \fBar\fP implementations, you can pass the
\fI\%U\fP modifier to write actual timestamps and UIDs/GIDs.
.UNINDENT
.UNINDENT
.sp
\fIWindows Paths\fP
.INDENT 0.0
.INDENT 3.5
When on Windows \fBllvm\-ar\fP treats the names of archived \fIfiles\fP in the same
case sensitive manner as the operating system. When on a non\-Windows machine
\fBllvm\-ar\fP does not consider character case.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.SH OPTIONS .SH OPTIONS
.sp .sp
The options to \fBllvm\-ar\fP are compatible with other \fBar\fP implementations. \fBllvm\-ar\fP operations are compatible with other \fBar\fP
However, there are a few modifiers (\fIR\fP) that are not found in other \fBar\fP implementations. However, there are a few modifiers (\fI\%L\fP) that are not
implementations. The options to \fBllvm\-ar\fP specify a single basic operation to found in other \fBar\fP implementations. The options for
perform on the archive, a variety of modifiers for that operation, the name of \fBllvm\-ar\fP specify a single basic Operation to perform on the archive,
the archive file, and an optional list of file names. These options are used to a variety of Modifiers for that Operation, the name of the archive file, and an
determine how \fBllvm\-ar\fP should process the archive file. optional list of file names. If the \fIfiles\fP option is not specified, it
generally means either "none" or "all" members, depending on the operation. The
Options, Operations and Modifiers are explained in the sections below.
.sp .sp
The Operations and Modifiers are explained in the sections below. The minimal The minimal set of options is at least one operator and the name of the
set of options is at least one operator and the name of the archive. Typically archive.
archive files end with a \fB\&.a\fP suffix, but this is not required. Following
the \fIarchive\-name\fP comes a list of \fIfiles\fP that indicate the specific members
of the archive to operate on. If the \fIfiles\fP option is not specified, it
generally means either "none" or "all" members, depending on the operation.
.SS Operations .SS Operations
.sp
d
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
Delete files from the archive. No modifiers are applicable to this operation. .B d [NT]
The \fIfiles\fP options specify which members should be removed from the Delete files from the \fBarchive\fP\&. The \fI\%N\fP and \fI\%T\fP modifiers
archive. It is not an error if a specified file does not appear in the archive. apply to this operation. The \fIfiles\fP options specify which members should be
If no \fIfiles\fP are specified, the archive is not modified. removed from the archive. It is not an error if a specified file does not
appear in the archive. If no \fIfiles\fP are specified, the archive is not
modified.
.UNINDENT .UNINDENT
.UNINDENT
.sp
m[abi]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
Move files from one location in the archive to another. The \fIa\fP, \fIb\fP, and .B m [abi]
\fIi\fP modifiers apply to this operation. The \fIfiles\fP will all be moved Move files from one location in the \fBarchive\fP to another. The \fI\%a\fP,
to the location given by the modifiers. If no modifiers are used, the files \fI\%b\fP, and \fI\%i\fP modifiers apply to this operation. The \fIfiles\fP
will be moved to the end of the archive. If no \fIfiles\fP are specified, the will all be moved to the location given by the modifiers. If no modifiers are
archive is not modified. used, the files will be moved to the end of the archive. If no \fIfiles\fP are
specified, the archive is not modified.
.UNINDENT .UNINDENT
.UNINDENT
.sp
p
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
Print files to the standard output. This operation simply prints the .B p [v]
\fIfiles\fP indicated to the standard output. If no \fIfiles\fP are Print \fIfiles\fP to the standard output stream. If no \fIfiles\fP are specified, the
specified, the entire archive is printed. Printing bitcode files is entire \fBarchive\fP is printed. With the \fI\%v\fP modifier,
ill\-advised as they might confuse your terminal settings. The \fIp\fP \fBllvm\-ar\fP also prints out the name of the file being output. Printing
operation never modifies the archive. binary files is ill\-advised as they might confuse your terminal settings. The
\fI\%p\fP operation never modifies the archive.
.UNINDENT .UNINDENT
.UNINDENT
.sp
q
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
Quickly append files to the end of the archive. This operation quickly adds the .B q [LT]
\fIfiles\fP to the archive without checking for duplicates that should be Quickly append files to the end of the \fBarchive\fP without removing
removed first. If no \fIfiles\fP are specified, the archive is not modified. duplicates. If no \fIfiles\fP are specified, the archive is not modified. The
Because of the way that \fBllvm\-ar\fP constructs the archive file, its dubious behavior when appending one archive to another depends upon whether the
whether the \fIq\fP operation is any faster than the \fIr\fP operation. \fI\%L\fP and \fI\%T\fP modifiers are used:
.INDENT 7.0
.IP \(bu 2
Appending a regular archive to a regular archive will append the archive
file. If the \fI\%L\fP modifier is specified the members will be appended
instead.
.IP \(bu 2
Appending a regular archive to a thin archive requires the \fI\%T\fP
modifier and will append the archive file. The \fI\%L\fP modifier is not
supported.
.IP \(bu 2
Appending a thin archive to a regular archive will append the archive file.
If the \fI\%L\fP modifier is specified the members will be appended
instead.
.IP \(bu 2
Appending a thin archive to a thin archive will always quick append its
members.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp
r[abu]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
Replace or insert file members. The \fIa\fP, \fIb\fP, and \fIu\fP .B r [abTu]
modifiers apply to this operation. This operation will replace existing Replace existing \fIfiles\fP or insert them at the end of the \fBarchive\fP if
\fIfiles\fP or insert them at the end of the archive if they do not exist. If no they do not exist. The \fI\%a\fP, \fI\%b\fP, \fI\%T\fP and \fI\%u\fP
\fIfiles\fP are specified, the archive is not modified. modifiers apply to this operation. If no \fIfiles\fP are specified, the archive
.UNINDENT is not modified.
.UNINDENT .UNINDENT
.sp .sp
t[v] t[v]
.. option:: t [vO]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Print the table of contents. Without any modifiers, this operation just prints Print the table of contents. Without any modifiers, this operation just prints
the names of the members to the standard output. With the \fIv\fP modifier, the names of the members to the standard output stream. With the \fI\%v\fP
\fBllvm\-ar\fP also prints out the file type (B=bitcode, S=symbol modifier, \fBllvm\-ar\fP also prints out the file type (B=bitcode,
table, blank=regular file), the permission mode, the owner and group, the S=symbol table, blank=regular file), the permission mode, the owner and group,
size, and the date. If any \fIfiles\fP are specified, the listing is only for are ignored when extracting \fIfiles\fP and set to placeholder values when adding
those files. If no \fIfiles\fP are specified, the table of contents for the size, and the date. With the \fI\%O\fP modifier, display member offsets. If
whole archive is printed. any \fIfiles\fP are specified, the listing is only for those files. If no \fIfiles\fP
are specified, the table of contents for the whole archive is printed.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp
x[oP]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
Extract archive members back to files. The \fIo\fP modifier applies to this .B V
operation. This operation retrieves the indicated \fIfiles\fP from the archive A synonym for the \fI\%\-\-version\fP option.
and writes them back to the operating system\(aqs file system. If no
\fIfiles\fP are specified, the entire archive is extract.
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B x [oP]
Extract \fBarchive\fP members back to files. The \fI\%o\fP modifier applies
to this operation. This operation retrieves the indicated \fIfiles\fP from the
archive and writes them back to the operating system\(aqs file system. If no
\fIfiles\fP are specified, the entire archive is extracted.
.UNINDENT .UNINDENT
.SS Modifiers (operation specific) .SS Modifiers (operation specific)
.sp .sp
The modifiers below are specific to certain operations. See the Operations The modifiers below are specific to certain operations. See the Operations
section (above) to determine which modifiers are applicable to which operations. section to determine which modifiers are applicable to which operations.
.sp
[a]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
When inserting or moving member files, this option specifies the destination of .B a
the new files as being after the \fIrelpos\fP member. If \fIrelpos\fP is not found, When inserting or moving member files, this option specifies the destination
the files are placed at the end of the archive. of the new files as being after the \fIrelpos\fP member. If \fIrelpos\fP is not found,
the files are placed at the end of the \fBarchive\fP\&. \fIrelpos\fP cannot be
consumed without either \fI\%a\fP, \fI\%b\fP or \fI\%i\fP\&.
.UNINDENT .UNINDENT
.UNINDENT
.sp
[b]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
When inserting or moving member files, this option specifies the destination of .B b
the new files as being before the \fIrelpos\fP member. If \fIrelpos\fP is not When inserting or moving member files, this option specifies the destination
found, the files are placed at the end of the archive. This modifier is of the new files as being before the \fIrelpos\fP member. If \fIrelpos\fP is not
identical to the \fIi\fP modifier. found, the files are placed at the end of the \fBarchive\fP\&. \fIrelpos\fP cannot
be consumed without either \fI\%a\fP, \fI\%b\fP or \fI\%i\fP\&. This
modifier is identical to the \fI\%i\fP modifier.
.UNINDENT .UNINDENT
.UNINDENT
.sp
[i]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
A synonym for the \fIb\fP option. .B i
A synonym for the \fI\%b\fP option.
.UNINDENT .UNINDENT
.UNINDENT
.sp
[o]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
When extracting files, this option will cause \fBllvm\-ar\fP to preserve the .B L
original modification times of the files it writes. When quick appending an \fBarchive\fP, instead quick append its members. This
is a feature for \fBllvm\-ar\fP that is not found in gnu\-ar.
.UNINDENT .UNINDENT
.UNINDENT
.sp
[u]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
When replacing existing files in the archive, only replace those files that have .B N
a time stamp than the time stamp of the member in the archive. When extracting or deleting a member that shares its name with another member,
the \fIcount\fP parameter allows you to supply a positive whole number that
selects the instance of the given name, with "1" indicating the first
instance. If \fI\%N\fP is not specified the first member of that name will
be selected. If \fIcount\fP is not supplied, the operation fails.*count* cannot be
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B o
When extracting files, use the modification times of any \fIfiles\fP as they
appear in the \fBarchive\fP\&. By default \fIfiles\fP extracted from the archive
use the time of extraction.
.UNINDENT
.INDENT 0.0
.TP
.B O
Display member offsets inside the archive.
.UNINDENT
.INDENT 0.0
.TP
.B T
When creating or modifying an archive, this option specifies that the
\fBarchive\fP will be thin. By default, archives are not created as thin
archives and when modifying a thin archive, it will be converted to a regular
archive.
.UNINDENT
.INDENT 0.0
.TP
.B v
When printing \fIfiles\fP or the \fBarchive\fP table of contents, this modifier
instructs \fBllvm\-ar\fP to include additional information in the output.
.UNINDENT .UNINDENT
.SS Modifiers (generic) .SS Modifiers (generic)
.sp .sp
The modifiers below may be applied to any operation. The modifiers below may be applied to any operation.
.sp
[c]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
For all operations, \fBllvm\-ar\fP will always create the archive if it doesn\(aqt .B c
exist. Normally, \fBllvm\-ar\fP will print a warning message indicating that the For the \fI\%r\fP (replace)and \fI\%q\fP (quick update) operations,
archive is being created. Using this modifier turns off that warning. \fBllvm\-ar\fP will always create the archive if it doesn\(aqt exist.
Normally, \fBllvm\-ar\fP will print a warning message indicating that the
\fBarchive\fP is being created. Using this modifier turns off
that warning.
.UNINDENT .UNINDENT
.UNINDENT
.sp
[s]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
.B D
Use zero for timestamps and UIDs/GIDs. This is set by default.
.UNINDENT
.INDENT 0.0
.TP
.B P
Use full paths when matching member names rather than just the file name.
This can be useful when manipulating an \fBarchive\fP generated by another
archiver, as some allow paths as member names. This is the default behavior
for thin archives.
.UNINDENT
.INDENT 0.0
.TP
.B s
This modifier requests that an archive index (or symbol table) be added to the This modifier requests that an archive index (or symbol table) be added to the
archive. This is the default mode of operation. The symbol table will contain \fBarchive\fP, as if using ranlib. The symbol table will contain all the
all the externally visible functions and global variables defined by all the externally visible functions and global variables defined by all the bitcode
bitcode files in the archive. files in the archive. By default \fBllvm\-ar\fP generates symbol tables in
archives. This can also be used as an operation.
.UNINDENT .UNINDENT
.UNINDENT
.sp
[S]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This modifier is the opposite of the \fIs\fP modifier. It instructs \fBllvm\-ar\fP to .B S
not build the symbol table. If both \fIs\fP and \fIS\fP are used, the last modifier to This modifier is the opposite of the \fI\%s\fP modifier. It instructs
occur in the options will prevail. \fBllvm\-ar\fP to not build the symbol table. If both \fI\%s\fP and
\fI\%S\fP are used, the last modifier to occur in the options will prevail.
.UNINDENT .UNINDENT
.UNINDENT
.sp
[v]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This modifier instructs \fBllvm\-ar\fP to be verbose about what it is doing. Each .B u
editing operation taken against the archive will produce a line of output saying Only update \fBarchive\fP members with \fIfiles\fP that have more recent
what is being done. timestamps.
.UNINDENT .UNINDENT
.UNINDENT
.SH STANDARDS
.sp
The \fBllvm\-ar\fP utility is intended to provide a superset of the IEEE Std 1003.2
(POSIX.2) functionality for \fBar\fP\&. \fBllvm\-ar\fP can read both SVR4 and BSD4.4 (or
Mac OS X) archives. If the \fBf\fP modifier is given to the \fBx\fP or \fBr\fP operations
then \fBllvm\-ar\fP will write SVR4 compatible archives. Without this modifier,
\fBllvm\-ar\fP will write BSD4.4 compatible archives that have long names
immediately after the header and indicated using the "#1/ddd" notation for the
name in the header.
.SH FILE FORMAT
.sp
The file format for LLVM Archive files is similar to that of BSD 4.4 or Mac OSX
archive files. In fact, except for the symbol table, the \fBar\fP commands on those
operating systems should be able to read LLVM archive files. The details of the
file format follow.
.sp
Each archive begins with the archive magic number which is the eight printable
characters "!<arch>n" where n represents the newline character (0x0A).
Following the magic number, the file is composed of even length members that
begin with an archive header and end with a n padding character if necessary
(to make the length even). Each file member is composed of a header (defined
below), an optional newline\-terminated "long file name" and the contents of
the file.
.sp
The fields of the header are described in the items below. All fields of the
header contain only ASCII characters, are left justified and are right padded
with space characters.
.sp
name \- char[16]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This field of the header provides the name of the archive member. If the name is .B U
longer than 15 characters or contains a slash (/) character, then this field Use actual timestamps and UIDs/GIDs.
contains \fB#1/nnn\fP where \fBnnn\fP provides the length of the name and the \fB#1/\fP
is literal. In this case, the actual name of the file is provided in the \fBnnn\fP
bytes immediately following the header. If the name is 15 characters or less, it
is contained directly in this field and terminated with a slash (/) character.
.UNINDENT .UNINDENT
.UNINDENT .SS Other
.sp
date \- char[12]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This field provides the date of modification of the file in the form of a .B \-\-format=<type>
decimal encoded number that provides the number of seconds since the epoch This option allows for default, gnu, darwin or bsd \fB<type>\fP to be selected.
(since 00:00:00 Jan 1, 1970) per Posix specifications. When creating an \fBarchive\fP, \fB<type>\fP will default to that of the host
machine.
.UNINDENT .UNINDENT
.UNINDENT
.sp
uid \- char[6]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This field provides the user id of the file encoded as a decimal ASCII string. .B \-h, \-\-help
This field might not make much sense on non\-Unix systems. On Unix, it is the Print a summary of command\-line options and their meanings.
same value as the st_uid field of the stat structure returned by the stat(2)
operating system call.
.UNINDENT .UNINDENT
.UNINDENT
.sp
gid \- char[6]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This field provides the group id of the file encoded as a decimal ASCII string. .B \-M
This field might not make much sense on non\-Unix systems. On Unix, it is the This option allows for MRI scripts to be read through the standard input
same value as the st_gid field of the stat structure returned by the stat(2) stream. No other options are compatible with this option.
operating system call.
.UNINDENT .UNINDENT
.UNINDENT
.sp
mode \- char[8]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This field provides the access mode of the file encoded as an octal ASCII .B \-\-version
string. This field might not make much sense on non\-Unix systems. On Unix, it Display the version of the \fBllvm\-ar\fP executable.
is the same value as the st_mode field of the stat structure returned by the
stat(2) operating system call.
.UNINDENT .UNINDENT
.UNINDENT
.sp
size \- char[10]
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
This field provides the size of the file, in bytes, encoded as a decimal ASCII .B @<FILE>
string. Read command\-line options and commands from response file \fB<FILE>\fP\&.
.UNINDENT
.UNINDENT .UNINDENT
.SH MRI SCRIPTS
.sp .sp
fmag \- char[2] \fBllvm\-ar\fP understands a subset of the MRI scripting interface commonly
.INDENT 0.0 supported by archivers following in the ar tradition. An MRI script contains a
.INDENT 3.5 sequence of commands to be executed by the archiver. The \fI\%\-M\fP option
This field is the archive file member magic number. Its content is always the allows for an MRI script to be passed to \fBllvm\-ar\fP through the
two characters back tick (0x60) and newline (0x0A). This provides some measure standard input stream.
utility in identifying archive files that have been corrupted.
.UNINDENT
.UNINDENT
.sp .sp
offset \- vbr encoded 32\-bit integer Note that \fBllvm\-ar\fP has known limitations regarding the use of MRI
scripts:
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .IP \(bu 2
The offset item provides the offset into the archive file where the bitcode Each script can only create one archive.
member is stored that is associated with the symbol. The offset value is 0 .IP \(bu 2
based at the start of the first "normal" file member. To derive the actual Existing archives can not be modified.
file offset of the member, you must add the number of bytes occupied by the file
signature (8 bytes) and the symbol tables. The value of this item is encoded
using variable bit rate encoding to reduce the size of the symbol table.
Variable bit rate encoding uses the high bit (0x80) of each byte to indicate
if there are more bytes to follow. The remaining 7 bits in each byte carry bits
from the value. The final byte does not have the high bit set.
.UNINDENT
.UNINDENT .UNINDENT
.SS MRI Script Commands
.sp .sp
length \- vbr encoded 32\-bit integer Each command begins with the command\(aqs name and must appear on its own line.
Some commands have arguments, which must be separated from the name by
whitespace. An MRI script should begin with either a \fI\%CREATE\fP or
\fI\%CREATETHIN\fP command and will typically end with a \fI\%SAVE\fP
command. Any text after either \(aq*\(aq or \(aq;\(aq is treated as a comment.
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
The length item provides the length of the symbol that follows. Like this .B CREATE archive
\fIoffset\fP item, the length is variable bit rate encoded. Begin creation of a regular archive with the specified name. Subsequent
commands act upon this \fBarchive\fP\&.
.UNINDENT .UNINDENT
.UNINDENT
.sp
symbol \- character array
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .TP
The symbol item provides the text of the symbol that is associated with the .B CREATETHIN archive
\fIoffset\fP\&. The symbol is not terminated by any character. Its length is provided Begin creation of a thin archive with the specified name. Subsequent
by the \fIlength\fP field. Note that is allowed (but unwise) to use non\-printing commands act upon this \fBarchive\fP\&.
characters (even 0x00) in the symbol. This allows for multiple encodings of
symbol names.
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B ADDLIB archive
Append the contents of \fBarchive\fP to the current archive.
.UNINDENT
.INDENT 0.0
.TP
.B ADDMOD <file>
Append \fB<file>\fP to the current archive.
.UNINDENT
.INDENT 0.0
.TP
.B DELETE <file>
Delete the member of the current archive whose file name, excluding directory
components, matches \fB<file>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B SAVE
Write the current archive to the path specified in the previous
\fI\%CREATE\fP/\fI\%CREATETHIN\fP command.
.UNINDENT
.INDENT 0.0
.TP
.B END
Ends the MRI script (optional).
.UNINDENT .UNINDENT
.SH EXIT STATUS .SH EXIT STATUS
.sp .sp
If \fBllvm\-ar\fP succeeds, it will exit with 0. A usage error, results If \fBllvm\-ar\fP succeeds, it will exit with 0. Otherwise, if an error occurs, it
in an exit code of 1. A hard (file system typically) error results in an will exit with a non\-zero value.
exit code of 2. Miscellaneous or unknown errors result in an
exit code of 3.
.SH SEE ALSO
.sp
ar(1)
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -0,0 +1,52 @@
.\" $FreeBSD$
.\" Man page generated from reStructuredText.
.
.TH "LLVM-RANLIB" "1" "2020-06-26" "10" "LLVM"
.SH NAME
llvm-ranlib \- generates an archive index
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBllvm\-ranlib\fP [\fIoptions\fP]
.SH DESCRIPTION
.sp
\fBllvm\-ranlib\fP is an alias for the llvm\-ar tool that
generates an index for an archive. It can be used as a replacement for GNU\(aqs
\fBranlib\fP tool.
.sp
Running \fBllvm\-ranlib\fP is equivalent to running \fBllvm\-ar s\fP\&.
.SH SEE ALSO
.sp
\fBllvm\-ar(1)\fP
.SH AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT
2003-2020, LLVM Project
.\" Generated by docutils manpage writer.
.

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-AS" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-AS" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-as \- LLVM assembler llvm-as \- LLVM assembler
. .
@ -78,10 +78,10 @@ If \fBllvm\-as\fP succeeds, it will exit with 0. Otherwise, if an error occurs,
will exit with a non\-zero value. will exit with a non\-zero value.
.SH SEE ALSO .SH SEE ALSO
.sp .sp
llvm\-dis|llvm\-dis, gccas|gccas \fBllvm\-dis(1)\fP, as(1)
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-BCANALYZER" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-BCANALYZER" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-bcanalyzer \- LLVM bitcode analyzer llvm-bcanalyzer \- LLVM bitcode analyzer
. .
@ -467,10 +467,10 @@ Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
.UNINDENT .UNINDENT
.SH SEE ALSO .SH SEE ALSO
.sp .sp
/CommandGuide/llvm\-dis, /BitCodeFormat \fBllvm\-dis(1)\fP, /BitCodeFormat
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-COV" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-COV" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-cov \- emit coverage information llvm-cov \- emit coverage information
. .
@ -178,6 +178,12 @@ option.
.B \-version .B \-version
Display the version of llvm\-cov. Display the version of llvm\-cov.
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B \-x, \-\-hash\-filenames
Use md5 hash of file name when naming the coverage output files. The source
file name will be suffixed by \fB##\fP followed by MD5 hash calculated for it.
.UNINDENT
.SS EXIT STATUS .SS EXIT STATUS
.sp .sp
\fBllvm\-cov gcov\fP returns 1 if it cannot read input files. Otherwise, \fBllvm\-cov gcov\fP returns 1 if it cannot read input files. Otherwise,
@ -192,6 +198,9 @@ The \fBllvm\-cov show\fP command shows line by line coverage of the
binaries \fIBIN\fP,... using the profile data \fIPROFILE\fP\&. It can optionally be binaries \fIBIN\fP,... using the profile data \fIPROFILE\fP\&. It can optionally be
filtered to only show the coverage for the files listed in \fISOURCES\fP\&. filtered to only show the coverage for the files listed in \fISOURCES\fP\&.
.sp .sp
\fIBIN\fP may be an executable, object file, dynamic library, or archive (thin or
otherwise).
.sp
To use \fBllvm\-cov show\fP, you need a program that is compiled with To use \fBllvm\-cov show\fP, you need a program that is compiled with
instrumentation to emit profile and coverage data. To build such a program with instrumentation to emit profile and coverage data. To build such a program with
\fBclang\fP use the \fB\-fprofile\-instr\-generate\fP and \fB\-fcoverage\-mapping\fP \fBclang\fP use the \fB\-fprofile\-instr\-generate\fP and \fB\-fcoverage\-mapping\fP
@ -351,6 +360,9 @@ The \fBllvm\-cov report\fP command displays a summary of the coverage of
the binaries \fIBIN\fP,... using the profile data \fIPROFILE\fP\&. It can optionally be the binaries \fIBIN\fP,... using the profile data \fIPROFILE\fP\&. It can optionally be
filtered to only show the coverage for the files listed in \fISOURCES\fP\&. filtered to only show the coverage for the files listed in \fISOURCES\fP\&.
.sp .sp
\fIBIN\fP may be an executable, object file, dynamic library, or archive (thin or
otherwise).
.sp
If no source files are provided, a summary line is printed for each file in the If no source files are provided, a summary line is printed for each file in the
coverage data. If any files are provided, summaries can be shown for each coverage data. If any files are provided, summaries can be shown for each
function in the listed files if the \fB\-show\-functions\fP option is enabled. function in the listed files if the \fB\-show\-functions\fP option is enabled.
@ -392,9 +404,15 @@ Skip source code files with file paths that match the given regular expression.
\fBllvm\-cov export\fP [\fIoptions\fP] \-instr\-profile \fIPROFILE\fP \fIBIN\fP [\fI\-object BIN,...\fP] [[\fI\-object BIN\fP]] [\fISOURCES\fP] \fBllvm\-cov export\fP [\fIoptions\fP] \-instr\-profile \fIPROFILE\fP \fIBIN\fP [\fI\-object BIN,...\fP] [[\fI\-object BIN\fP]] [\fISOURCES\fP]
.SS DESCRIPTION .SS DESCRIPTION
.sp .sp
The \fBllvm\-cov export\fP command exports regions, functions, expansions, The \fBllvm\-cov export\fP command exports coverage data of the binaries
and summaries of the coverage of the binaries \fIBIN\fP,... using the profile data \fIBIN\fP,... using the profile data \fIPROFILE\fP in either JSON or lcov trace file
\fIPROFILE\fP as JSON. It can optionally be filtered to only export the coverage format.
.sp
When exporting JSON, the regions, functions, expansions, and summaries of the
coverage data will be exported. When exporting an lcov trace file, the
line\-based coverage and summaries will be exported.
.sp
The exported data can optionally be filtered to only export the coverage
for the files listed in \fISOURCES\fP\&. for the files listed in \fISOURCES\fP\&.
.sp .sp
For information on compiling programs for coverage and generating profile data, For information on compiling programs for coverage and generating profile data,
@ -410,20 +428,46 @@ non\-universal binary.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-format=<FORMAT>
Use the specified output format. The supported formats are: "text" (JSON),
"lcov".
.UNINDENT
.INDENT 0.0
.TP
.B \-summary\-only .B \-summary\-only
Export only summary information for each file in the coverage data. This mode Export only summary information for each file in the coverage data. This mode
will not export coverage information for smaller units such as individual will not export coverage information for smaller units such as individual
functions or regions. The result will be the same as produced by :program: functions or regions. The result will contain the same information as produced
\fIllvm\-cov report\fP command, but presented in JSON format rather than text. by the \fBllvm\-cov report\fP command, but presented in JSON or lcov
format rather than text.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-ignore\-filename\-regex=<PATTERN> .B \-ignore\-filename\-regex=<PATTERN>
Skip source code files with file paths that match the given regular expression. Skip source code files with file paths that match the given regular expression.
.INDENT 7.0
.TP
.B \-skip\-expansions
.UNINDENT
.sp
Skip exporting macro expansion coverage data.
.INDENT 7.0
.TP
.B \-skip\-functions
.UNINDENT
.sp
Skip exporting per\-function coverage data.
.INDENT 7.0
.TP
.B \-num\-threads=N, \-j=N
.UNINDENT
.sp
Use N threads to export coverage data. When N=0, llvm\-cov auto\-detects an
appropriate number of threads to use. This is the default.
.UNINDENT .UNINDENT
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,6 @@
# $FreeBSD$ # $FreeBSD$
PROG_CXX= llvm-cxxfilt PROG_CXX= llvm-cxxfilt
MAN=
SRCDIR= llvm/tools/llvm-cxxfilt SRCDIR= llvm/tools/llvm-cxxfilt
SRCS+= llvm-cxxfilt.cpp SRCS+= llvm-cxxfilt.cpp

View File

@ -0,0 +1,117 @@
.\" $FreeBSD$
.\" Man page generated from reStructuredText.
.
.TH "LLVM-CXXFILT" "1" "2020-06-26" "10" "LLVM"
.SH NAME
llvm-cxxfilt \- LLVM symbol name demangler
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBllvm\-cxxfilt\fP [\fIoptions\fP] [\fImangled names...\fP]
.SH DESCRIPTION
.sp
\fBllvm\-cxxfilt\fP is a symbol demangler that can be used as a replacement
for the GNU \fBc++filt\fP tool. It takes a series of symbol names and
prints their demangled form on the standard output stream. If a name cannot be
demangled, it is simply printed as is.
.sp
If no names are specified on the command\-line, names are read interactively from
the standard input stream. When reading names from standard input, each input
line is split on characters that are not part of valid Itanium name manglings,
i.e. characters that are not alphanumeric, \(aq.\(aq, \(aq$\(aq, or \(aq_\(aq. Separators between
names are copied to the output as is.
.SH EXAMPLE
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-cxxfilt _Z3foov _Z3bari not_mangled
foo()
bar(int)
not_mangled
$ cat input.txt
| _Z3foov *** _Z3bari *** not_mangled |
$ llvm\-cxxfilt < input.txt
| foo() *** bar(int) *** not_mangled |
.ft P
.fi
.UNINDENT
.UNINDENT
.SH OPTIONS
.INDENT 0.0
.TP
.B \-\-format=<value>, \-s
Mangling scheme to assume. Valid values are \fBauto\fP (default, auto\-detect the
style) and \fBgnu\fP (assume GNU/Itanium style).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help, \-h
Print a summary of command line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help\-list
Print an uncategorized summary of command line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-underscore, \-_
Discard a single leading underscore, if present, from each input name before
demangling.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-types, \-t
Attempt to demangle names as type names as well as function names.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Display the version of the \fBllvm\-cxxfilt\fP executable.
.UNINDENT
.INDENT 0.0
.TP
.B @<FILE>
Read command\-line options from response file \fI<FILE>\fP\&.
.UNINDENT
.SH EXIT STATUS
.sp
\fBllvm\-cxxfilt\fP returns 0 unless it encounters a usage error, in which
case a non\-zero exit code is returned.
.SH SEE ALSO
.sp
\fBllvm\-nm(1)\fP
.SH AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT
2003-2020, LLVM Project
.\" Generated by docutils manpage writer.
.

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-DIFF" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-DIFF" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-diff \- LLVM structural 'diff' llvm-diff \- LLVM structural 'diff'
. .
@ -70,8 +70,8 @@ attributes, are not diagnosed.
Changes in memory behavior (for example, coalescing loads) can cause Changes in memory behavior (for example, coalescing loads) can cause
massive detected differences in blocks. massive detected differences in blocks.
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-DIS" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-DIS" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-dis \- LLVM disassembler llvm-dis \- LLVM disassembler
. .
@ -79,10 +79,10 @@ If \fBllvm\-dis\fP succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non\-zero value. occurs, it will exit with a non\-zero value.
.SH SEE ALSO .SH SEE ALSO
.sp .sp
llvm\-as|llvm\-as \fBllvm\-as(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-DWARFDUMP" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-DWARFDUMP" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-dwarfdump \- dump and verify DWARF debug information llvm-dwarfdump \- dump and verify DWARF debug information
. .
@ -40,11 +40,15 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
archives, and \fI\&.dSYM\fP bundles and prints their contents in archives, and \fI\&.dSYM\fP bundles and prints their contents in
human\-readable form. Only the .debug_info section is printed unless one of human\-readable form. Only the .debug_info section is printed unless one of
the section\-specific options or \fI\%\-\-all\fP is specified. the section\-specific options or \fI\%\-\-all\fP is specified.
.sp
If no input file is specified, \fIa.out\fP is used instead. If \fI\-\fP is used as the
input file, \fBllvm\-dwarfdump\fP reads the input from its standard input
stream.
.SH OPTIONS .SH OPTIONS
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-a, \-\-all .B \-a, \-\-all
Disassemble all supported DWARF sections. Dump all supported DWARF sections.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -58,9 +62,14 @@ default.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-c, \-\-show\-children .B \-c, \-\-show\-children
Show a debug info entry\(aqs children when using Show a debug info entry\(aqs children when selectively printing with
the \fI\%\-\-debug\-info\fP, \fI\%\-\-find\fP, the \fI=<offset>\fP argument of \fI\%\-\-debug\-info\fP, or options such
and \fI\%\-\-name\fP options. as \fI\%\-\-find\fP or \fI\%\-\-name\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-color
Use colors in output.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -83,42 +92,56 @@ Show help and usage for this command.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-i, \-\-ignore\-case .B \-\-help\-list
Ignore case distinctions in when searching entries by name Show help and usage for this command without grouping the options
or by regular expression. into categories.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-n <pattern>, \-\-name=<pattern> .B \-i, \-\-ignore\-case
Ignore case distinctions when using \fI\%\-\-name\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-n <name>, \-\-name=<name>
Find and print all debug info entries whose name Find and print all debug info entries whose name
(\fIDW_AT_name\fP attribute) matches the exact text in (\fIDW_AT_name\fP attribute) is <name>.
<pattern>. Use the \fI\%\-\-regex\fP option to have
<pattern> become a regular expression for more flexible
pattern matching.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-lookup=<address> .B \-\-lookup=<address>
Lookup <address> in the debug information and print out the file, Look up <address> in the debug information and print out the file,
function, block, and line table details. function, block, and line table details.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-o <path>, \-\-out\-file=<path> .B \-o <path>
Redirect output to a file specified by <path>. Redirect output to a file specified by <path>, where \fI\-\fP is the
standard output stream.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-p, \-\-show\-parents .B \-p, \-\-show\-parents
Show a debug info entry\(aqs parent objects when using the Show a debug info entry\(aqs parents when selectively printing with
\fI\%\-\-debug\-info\fP, \fI\%\-\-find\fP, and the \fI=<offset>\fP argument of \fI\%\-\-debug\-info\fP, or options such
\fI\%\-\-name\fP options. as \fI\%\-\-find\fP or \fI\%\-\-name\fP\&.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-r <n>, \-\-recurse\-depth=<n> .B \-\-parent\-recurse\-depth=<N>
Only recurse to a maximum depth of <n> when dumping debug info When displaying debug info entry parents, only show them to a
entries. maximum depth of <N>.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-quiet
Use with \fI\%\-\-verify\fP to not emit to \fISTDOUT\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-r <N>, \-\-recurse\-depth=<N>
When displaying debug info entries, only show children to a maximum
depth of <N>.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -128,9 +151,15 @@ as machine\-readable single\-line JSON output.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-summarize\-types
Abbreviate the description of type unit entries.
.UNINDENT
.INDENT 0.0
.TP
.B \-x, \-\-regex .B \-x, \-\-regex
Treat any <pattern> strings as regular expressions when searching Treat any <name> strings as regular expressions when searching
instead of just as an exact string match. with \fI\%\-\-name\fP\&. If \fI\%\-\-ignore\-case\fP is also specified,
the regular expression becomes case\-insensitive.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -163,16 +192,19 @@ Display the version of the tool.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-debug\-abbrev, \-\-debug\-aranges, \-\-debug\-cu\-index, \-\-debug\-frame [=<offset>], \-\-debug\-gnu\-pubnames, \-\-debug\-gnu\-pubtypes, \-\-debug\-info [=<offset>], \-\-debug\-line [=<offset>], \-\-debug\-loc [=<offset>], \-\-debug\-macro, \-\-debug\-pubnames, \-\-debug\-pubtypes, \-\-debug\-ranges, \-\-debug\-str, \-\-debug\-str\-offsets, \-\-debug\-tu\-index, \-\-debug\-types, \-\-eh\-frame, \-\-gdb\-index, \-\-apple\-names, \-\-apple\-types, \-\-apple\-namespaces, \-\-apple\-objc .B \-\-debug\-abbrev, \-\-debug\-addr, \-\-debug\-aranges, \-\-debug\-cu\-index, \-\-debug\-frame [=<offset>], \-\-debug\-gnu\-pubnames, \-\-debug\-gnu\-pubtypes, \-\-debug\-info [=<offset>], \-\-debug\-line [=<offset>], \-\-debug\-line\-str, \-\-debug\-loc [=<offset>], \-\-debug\-loclists [=<offset>], \-\-debug\-macro, \-\-debug\-names, \-\-debug\-pubnames, \-\-debug\-pubtypes, \-\-debug\-ranges, \-\-debug\-rnglists, \-\-debug\-str, \-\-debug\-str\-offsets, \-\-debug\-tu\-index, \-\-debug\-types, \-\-eh\-frame [=<offset>], \-\-gdb\-index, \-\-apple\-names, \-\-apple\-types, \-\-apple\-namespaces, \-\-apple\-objc
Dump the specified DWARF section by name. Only the Dump the specified DWARF section by name. Only the
\fI\&.debug_info\fP section is shown by default. Some entries \fI\&.debug_info\fP section is shown by default. Some entries
support adding an \fI=<offset>\fP as a way to provide an support adding an \fI=<offset>\fP as a way to provide an
optional offset of the exact entry to dump within the optional offset of the exact entry to dump within the
respective section. When an offset is provided, only the respective section. When an offset is provided, only the
entry at that offset will be dumped, else the entire entry at that offset will be dumped, else the entire
section will be dumped. Children of items at a specific section will be dumped.
offset can be dumped by also using the .UNINDENT
\fI\%\-\-show\-children\fP option where applicable. .INDENT 0.0
.TP
.B @<FILE>
Read command\-line options from \fI<FILE>\fP\&.
.UNINDENT .UNINDENT
.SH EXIT STATUS .SH EXIT STATUS
.sp .sp
@ -182,8 +214,8 @@ successfully. Otherwise, it returns 1.
.sp .sp
\fBdsymutil(1)\fP \fBdsymutil(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-EXTRACT" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-EXTRACT" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-extract \- extract a function from an LLVM module llvm-extract \- extract a function from an LLVM module
. .
@ -120,10 +120,10 @@ If \fBllvm\-extract\fP succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non\-zero value. occurs, it will exit with a non\-zero value.
.SH SEE ALSO .SH SEE ALSO
.sp .sp
bugpoint \fBbugpoint(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-LINK" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-LINK" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-link \- LLVM bitcode linker llvm-link \- LLVM bitcode linker
. .
@ -38,7 +38,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.sp .sp
\fBllvm\-link\fP takes several LLVM bitcode files and links them together \fBllvm\-link\fP takes several LLVM bitcode files and links them together
into a single LLVM bitcode file. It writes the output file to standard output, into a single LLVM bitcode file. It writes the output file to standard output,
unless the \fB\-o\fP option is used to specify a filename. unless the \fI\%\-o\fP option is used to specify a filename.
.SH OPTIONS .SH OPTIONS
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -82,8 +82,8 @@ library found.
If \fBllvm\-link\fP succeeds, it will exit with 0. Otherwise, if an error If \fBllvm\-link\fP succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non\-zero value. occurs, it will exit with a non\-zero value.
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-MCA" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-MCA" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-mca \- LLVM Machine Code Analyzer llvm-mca \- LLVM Machine Code Analyzer
. .
@ -48,55 +48,12 @@ The main goal of this tool is not just to predict the performance of the code
when run on the target, but also help with diagnosing potential performance when run on the target, but also help with diagnosing potential performance
issues. issues.
.sp .sp
Given an assembly code sequence, llvm\-mca estimates the Instructions Per Cycle Given an assembly code sequence, \fBllvm\-mca\fP estimates the Instructions
(IPC), as well as hardware resource pressure. The analysis and reporting style Per Cycle (IPC), as well as hardware resource pressure. The analysis and
were inspired by the IACA tool from Intel. reporting style were inspired by the IACA tool from Intel.
.sp .sp
\fBllvm\-mca\fP allows the usage of special code comments to mark regions of For example, you can compile code with clang, output assembly, and pipe it
the assembly code to be analyzed. A comment starting with substring directly into \fBllvm\-mca\fP for analysis:
\fBLLVM\-MCA\-BEGIN\fP marks the beginning of a code region. A comment starting with
substring \fBLLVM\-MCA\-END\fP marks the end of a code region. For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# LLVM\-MCA\-BEGIN My Code Region
...
# LLVM\-MCA\-END
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Multiple regions can be specified provided that they do not overlap. A code
region can have an optional description. If no user\-defined region is specified,
then \fBllvm\-mca\fP assumes a default region which contains every
instruction in the input file. Every region is analyzed in isolation, and the
final performance report is the union of all the reports generated for every
code region.
.sp
Inline assembly directives may be used from source code to annotate the
assembly text:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
int foo(int a, int b) {
__asm volatile("# LLVM\-MCA\-BEGIN foo");
a += 42;
__asm volatile("# LLVM\-MCA\-END");
a *= b;
return a;
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
So for example, you can compile code with clang, output assembly, and pipe it
directly into llvm\-mca for analysis:
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.sp .sp
@ -119,13 +76,24 @@ $ clang foo.c \-O2 \-target x86_64\-unknown\-unknown \-mllvm \-x86\-asm\-syntax=
.fi .fi
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp
Scheduling models are not just used to compute instruction latencies and
throughput, but also to understand what processor resources are available
and how to simulate them.
.sp
By design, the quality of the analysis conducted by \fBllvm\-mca\fP is
inevitably affected by the quality of the scheduling models in LLVM.
.sp
If you see that the performance report is not accurate for a processor,
please \fI\%file a bug\fP
against the appropriate backend.
.SH OPTIONS .SH OPTIONS
.sp .sp
If \fBinput\fP is "\fB\-\fP" or omitted, \fBllvm\-mca\fP reads from standard If \fBinput\fP is "\fB\-\fP" or omitted, \fBllvm\-mca\fP reads from standard
input. Otherwise, it will read from the specified filename. input. Otherwise, it will read from the specified filename.
.sp .sp
If the \fB\-o\fP option is omitted, then \fBllvm\-mca\fP will send its output If the \fI\%\-o\fP option is omitted, then \fBllvm\-mca\fP will send its output
to standard output if the input is from standard input. If the \fB\-o\fP to standard output if the input is from standard input. If the \fI\%\-o\fP
option specifies "\fB\-\fP", then the output will also be sent to standard output. option specifies "\fB\-\fP", then the output will also be sent to standard output.
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -134,6 +102,12 @@ Print a summary of command line options.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-o <filename>
Use \fB<filename>\fP as the output filename. See the summary above for more
details.
.UNINDENT
.INDENT 0.0
.TP
.B \-mtriple=<target triple> .B \-mtriple=<target triple>
Specify a target triple string. Specify a target triple string.
.UNINDENT .UNINDENT
@ -159,6 +133,12 @@ the analysis report.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-print\-imm\-hex
Prefer hex format for numeric literals in the output assembly printed as part
of the report.
.UNINDENT
.INDENT 0.0
.TP
.B \-dispatch=<width> .B \-dispatch=<width>
Specify a different dispatch width for the processor. The dispatch width Specify a different dispatch width for the processor. The dispatch width
defaults to field \(aqIssueWidth\(aq in the processor scheduling model. If width is defaults to field \(aqIssueWidth\(aq in the processor scheduling model. If width is
@ -251,6 +231,11 @@ Enable the instruction info view. This is enabled by default.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-show\-encoding
Enable the printing of instruction encodings within the instruction info view.
.UNINDENT
.INDENT 0.0
.TP
.B \-all\-stats .B \-all\-stats
Print all hardware statistics. This enables extra statistics related to the Print all hardware statistics. This enables extra statistics related to the
dispatch logic, the hardware schedulers, the register file(s), and the retire dispatch logic, the hardware schedulers, the register file(s), and the retire
@ -270,10 +255,127 @@ view because it doesn\(aqt require that the code is simulated. It instead prints
the theoretical uniform distribution of resource pressure for every the theoretical uniform distribution of resource pressure for every
instruction in sequence. instruction in sequence.
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B \-bottleneck\-analysis
Print information about bottlenecks that affect the throughput. This analysis
can be expensive, and it is disabled by default. Bottlenecks are highlighted
in the summary view.
.UNINDENT
.SH EXIT STATUS .SH EXIT STATUS
.sp .sp
\fBllvm\-mca\fP returns 0 on success. Otherwise, an error message is printed \fBllvm\-mca\fP returns 0 on success. Otherwise, an error message is printed
to standard error, and the tool returns 1. to standard error, and the tool returns 1.
.SH USING MARKERS TO ANALYZE SPECIFIC CODE BLOCKS
.sp
\fBllvm\-mca\fP allows for the optional usage of special code comments to
mark regions of the assembly code to be analyzed. A comment starting with
substring \fBLLVM\-MCA\-BEGIN\fP marks the beginning of a code region. A comment
starting with substring \fBLLVM\-MCA\-END\fP marks the end of a code region. For
example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# LLVM\-MCA\-BEGIN
...
# LLVM\-MCA\-END
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
If no user\-defined region is specified, then \fBllvm\-mca\fP assumes a
default region which contains every instruction in the input file. Every region
is analyzed in isolation, and the final performance report is the union of all
the reports generated for every code region.
.sp
Code regions can have names. For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# LLVM\-MCA\-BEGIN A simple example
add %eax, %eax
# LLVM\-MCA\-END
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The code from the example above defines a region named "A simple example" with a
single instruction in it. Note how the region name doesn\(aqt have to be repeated
in the \fBLLVM\-MCA\-END\fP directive. In the absence of overlapping regions,
an anonymous \fBLLVM\-MCA\-END\fP directive always ends the currently active user
defined region.
.sp
Example of nesting regions:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# LLVM\-MCA\-BEGIN foo
add %eax, %edx
# LLVM\-MCA\-BEGIN bar
sub %eax, %edx
# LLVM\-MCA\-END bar
# LLVM\-MCA\-END foo
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example of overlapping regions:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
# LLVM\-MCA\-BEGIN foo
add %eax, %edx
# LLVM\-MCA\-BEGIN bar
sub %eax, %edx
# LLVM\-MCA\-END foo
add %eax, %edx
# LLVM\-MCA\-END bar
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Note that multiple anonymous regions cannot overlap. Also, overlapping regions
cannot have the same name.
.sp
There is no support for marking regions from high\-level source code, like C or
C++. As a workaround, inline assembly directives may be used:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
int foo(int a, int b) {
__asm volatile("# LLVM\-MCA\-BEGIN foo");
a += 42;
__asm volatile("# LLVM\-MCA\-END");
a *= b;
return a;
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
However, this interferes with optimizations like loop vectorization and may have
an impact on the code generated. This is because the \fB__asm\fP statements are
seen as real code having important side effects, which limits how the code
around them can be transformed. If users want to make use of inline assembly
to emit markers, then the recommendation is to always verify that the output
assembly is equivalent to the assembly generated in the absence of markers.
The \fI\%Clang options to emit optimization reports\fP
can also help in detecting missed optimizations.
.SH HOW LLVM-MCA WORKS .SH HOW LLVM-MCA WORKS
.sp .sp
\fBllvm\-mca\fP takes assembly code as input. The assembly code is parsed \fBllvm\-mca\fP takes assembly code as input. The assembly code is parsed
@ -309,7 +411,10 @@ $ llvm\-mca \-mtriple=x86_64\-unknown\-unknown \-mcpu=btver2 \-iterations=300 do
Iterations: 300 Iterations: 300
Instructions: 900 Instructions: 900
Total Cycles: 610 Total Cycles: 610
Total uOps: 900
Dispatch Width: 2 Dispatch Width: 2
uOps Per Cycle: 1.48
IPC: 1.48 IPC: 1.48
Block RThroughput: 2.0 Block RThroughput: 2.0
@ -360,40 +465,99 @@ Resource pressure by instruction:
.UNINDENT .UNINDENT
.sp .sp
According to this report, the dot\-product kernel has been executed 300 times, According to this report, the dot\-product kernel has been executed 300 times,
for a total of 900 dynamically executed instructions. for a total of 900 simulated instructions. The total number of simulated micro
opcodes (uOps) is also 900.
.sp .sp
The report is structured in three main sections. The first section collects a The report is structured in three main sections. The first section collects a
few performance numbers; the goal of this section is to give a very quick few performance numbers; the goal of this section is to give a very quick
overview of the performance throughput. In this example, the two important overview of the performance throughput. Important performance indicators are
performance indicators are \fBIPC\fP and \fBBlock RThroughput\fP (Block Reciprocal \fBIPC\fP, \fBuOps Per Cycle\fP, and \fBBlock RThroughput\fP (Block Reciprocal
Throughput). Throughput).
.sp .sp
Field \fIDispatchWidth\fP is the maximum number of micro opcodes that are dispatched
to the out\-of\-order backend every simulated cycle.
.sp
IPC is computed dividing the total number of simulated instructions by the total IPC is computed dividing the total number of simulated instructions by the total
number of cycles. A delta between Dispatch Width and IPC is an indicator of a number of cycles.
performance issue. In the absence of loop\-carried data dependencies, the
observed IPC tends to a theoretical maximum which can be computed by dividing
the number of instructions of a single iteration by the \fIBlock RThroughput\fP\&.
.sp .sp
IPC is bounded from above by the dispatch width. That is because the dispatch Field \fIBlock RThroughput\fP is the reciprocal of the block throughput. Block
width limits the maximum size of a dispatch group. IPC is also limited by the throuhgput is a theoretical quantity computed as the maximum number of blocks
amount of hardware parallelism. The availability of hardware resources affects (i.e. iterations) that can be executed per simulated clock cycle in the absence
the resource pressure distribution, and it limits the number of instructions of loop carried dependencies. Block throughput is is superiorly
that can be executed in parallel every cycle. A delta between Dispatch limited by the dispatch rate, and the availability of hardware resources.
Width and the theoretical maximum IPC is an indicator of a performance
bottleneck caused by the lack of hardware resources. In general, the lower the
Block RThroughput, the better.
.sp .sp
In this example, \fBInstructions per iteration/Block RThroughput\fP is 1.50. Since In the absence of loop\-carried data dependencies, the observed IPC tends to a
there are no loop\-carried dependencies, the observed IPC is expected to approach theoretical maximum which can be computed by dividing the number of instructions
1.50 when the number of iterations tends to infinity. The delta between the of a single iteration by the \fIBlock RThroughput\fP\&.
Dispatch Width (2.00), and the theoretical maximum IPC (1.50) is an indicator of
a performance bottleneck caused by the lack of hardware resources, and the
\fIResource pressure view\fP can help to identify the problematic resource usage.
.sp .sp
The second section of the report shows the latency and reciprocal Field \(aquOps Per Cycle\(aq is computed dividing the total number of simulated micro
throughput of every instruction in the sequence. That section also reports opcodes by the total number of cycles. A delta between Dispatch Width and this
extra information related to the number of micro opcodes, and opcode properties field is an indicator of a performance issue. In the absence of loop\-carried
(i.e., \(aqMayLoad\(aq, \(aqMayStore\(aq, and \(aqHasSideEffects\(aq). data dependencies, the observed \(aquOps Per Cycle\(aq should tend to a theoretical
maximum throughput which can be computed by dividing the number of uOps of a
single iteration by the \fIBlock RThroughput\fP\&.
.sp
Field \fIuOps Per Cycle\fP is bounded from above by the dispatch width. That is
because the dispatch width limits the maximum size of a dispatch group. Both IPC
and \(aquOps Per Cycle\(aq are limited by the amount of hardware parallelism. The
availability of hardware resources affects the resource pressure distribution,
and it limits the number of instructions that can be executed in parallel every
cycle. A delta between Dispatch Width and the theoretical maximum uOps per
Cycle (computed by dividing the number of uOps of a single iteration by the
\fIBlock RThroughput\fP) is an indicator of a performance bottleneck caused by the
lack of hardware resources.
In general, the lower the Block RThroughput, the better.
.sp
In this example, \fBuOps per iteration/Block RThroughput\fP is 1.50. Since there
are no loop\-carried dependencies, the observed \fIuOps Per Cycle\fP is expected to
approach 1.50 when the number of iterations tends to infinity. The delta between
the Dispatch Width (2.00), and the theoretical maximum uOp throughput (1.50) is
an indicator of a performance bottleneck caused by the lack of hardware
resources, and the \fIResource pressure view\fP can help to identify the problematic
resource usage.
.sp
The second section of the report is the \fIinstruction info view\fP\&. It shows the
latency and reciprocal throughput of every instruction in the sequence. It also
reports extra information related to the number of micro opcodes, and opcode
properties (i.e., \(aqMayLoad\(aq, \(aqMayStore\(aq, and \(aqHasSideEffects\(aq).
.sp
Field \fIRThroughput\fP is the reciprocal of the instruction throughput. Throughput
is computed as the maximum number of instructions of a same type that can be
executed per clock cycle in the absence of operand dependencies. In this
example, the reciprocal throughput of a vector float multiply is 1
cycles/instruction. That is because the FP multiplier JFPM is only available
from pipeline JFPU1.
.sp
Instruction encodings are displayed within the instruction info view when flag
\fI\-show\-encoding\fP is specified.
.sp
Below is an example of \fI\-show\-encoding\fP output for the dot\-product kernel:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Instruction Info:
[1]: #uOps
[2]: Latency
[3]: RThroughput
[4]: MayLoad
[5]: MayStore
[6]: HasSideEffects (U)
[7]: Encoding Size
[1] [2] [3] [4] [5] [6] [7] Encodings: Instructions:
1 2 1.00 4 c5 f0 59 d0 vmulps %xmm0, %xmm1, %xmm2
1 4 1.00 4 c5 eb 7c da vhaddps %xmm2, %xmm2, %xmm3
1 4 1.00 4 c5 e3 7c e3 vhaddps %xmm3, %xmm3, %xmm4
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The \fIEncoding Size\fP column shows the size in bytes of instructions. The
\fIEncodings\fP column shows the actual instruction encodings (byte sequences in
hex).
.sp .sp
The third section is the \fIResource pressure view\fP\&. This view reports The third section is the \fIResource pressure view\fP\&. This view reports
the average number of resource cycles consumed every iteration by instructions the average number of resource cycles consumed every iteration by instructions
@ -476,6 +640,7 @@ Average Wait times (based on the timeline view):
0. 3 1.0 1.0 3.3 vmulps %xmm0, %xmm1, %xmm2 0. 3 1.0 1.0 3.3 vmulps %xmm0, %xmm1, %xmm2
1. 3 3.3 0.7 1.0 vhaddps %xmm2, %xmm2, %xmm3 1. 3 3.3 0.7 1.0 vhaddps %xmm2, %xmm2, %xmm3
2. 3 5.7 0.0 0.0 vhaddps %xmm3, %xmm3, %xmm4 2. 3 5.7 0.0 0.0 vhaddps %xmm3, %xmm3, %xmm4
3 3.3 0.5 1.4 <total>
.ft P .ft P
.fi .fi
.UNINDENT .UNINDENT
@ -536,7 +701,8 @@ and therefore consuming physical registers).
.sp .sp
Table \fIAverage Wait times\fP helps diagnose performance issues that are caused by Table \fIAverage Wait times\fP helps diagnose performance issues that are caused by
the presence of long latency instructions and potentially long data dependencies the presence of long latency instructions and potentially long data dependencies
which may limit the ILP. Note that \fBllvm\-mca\fP, by default, assumes at which may limit the ILP. Last row, \fB<total>\fP, shows a global average over all
instructions measured. Note that \fBllvm\-mca\fP, by default, assumes at
least 1cy between the dispatch event and the issue event. least 1cy between the dispatch event and the issue event.
.sp .sp
When the performance is limited by data dependencies and/or long latency When the performance is limited by data dependencies and/or long latency
@ -548,14 +714,72 @@ instructions. When performance is mostly limited by the lack of hardware
resources, the delta between the two counters is small. However, the number of resources, the delta between the two counters is small. However, the number of
cycles spent in the queue tends to be larger (i.e., more than 1\-3cy), cycles spent in the queue tends to be larger (i.e., more than 1\-3cy),
especially when compared to other low latency instructions. especially when compared to other low latency instructions.
.SS Bottleneck Analysis
.sp
The \fB\-bottleneck\-analysis\fP command line option enables the analysis of
performance bottlenecks.
.sp
This analysis is potentially expensive. It attempts to correlate increases in
backend pressure (caused by pipeline resource pressure and data dependencies) to
dynamic dispatch stalls.
.sp
Below is an example of \fB\-bottleneck\-analysis\fP output generated by
\fBllvm\-mca\fP for 500 iterations of the dot\-product example on btver2.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
Cycles with backend pressure increase [ 48.07% ]
Throughput Bottlenecks:
Resource Pressure [ 47.77% ]
\- JFPA [ 47.77% ]
\- JFPU0 [ 47.77% ]
Data Dependencies: [ 0.30% ]
\- Register Dependencies [ 0.30% ]
\- Memory Dependencies [ 0.00% ]
Critical sequence based on the simulation:
Instruction Dependency Information
+\-\-\-\-< 2. vhaddps %xmm3, %xmm3, %xmm4
|
| < loop carried >
|
| 0. vmulps %xmm0, %xmm1, %xmm2
+\-\-\-\-> 1. vhaddps %xmm2, %xmm2, %xmm3 ## RESOURCE interference: JFPA [ probability: 74% ]
+\-\-\-\-> 2. vhaddps %xmm3, %xmm3, %xmm4 ## REGISTER dependency: %xmm3
|
| < loop carried >
|
+\-\-\-\-> 1. vhaddps %xmm2, %xmm2, %xmm3 ## RESOURCE interference: JFPA [ probability: 74% ]
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
According to the analysis, throughput is limited by resource pressure and not by
data dependencies. The analysis observed increases in backend pressure during
48.07% of the simulated run. Almost all those pressure increase events were
caused by contention on processor resources JFPA/JFPU0.
.sp
The \fIcritical sequence\fP is the most expensive sequence of instructions according
to the simulation. It is annotated to provide extra information about critical
register dependencies and resource interferences between instructions.
.sp
Instructions from the critical sequence are expected to significantly impact
performance. By construction, the accuracy of this analysis is strongly
dependent on the simulation and (as always) by the quality of the processor
model in llvm.
.SS Extra Statistics to Further Diagnose Performance Issues .SS Extra Statistics to Further Diagnose Performance Issues
.sp .sp
The \fB\-all\-stats\fP command line option enables extra statistics and performance The \fB\-all\-stats\fP command line option enables extra statistics and performance
counters for the dispatch logic, the reorder buffer, the retire control unit, counters for the dispatch logic, the reorder buffer, the retire control unit,
and the register file. and the register file.
.sp .sp
Below is an example of \fB\-all\-stats\fP output generated by MCA for the Below is an example of \fB\-all\-stats\fP output generated by \fBllvm\-mca\fP
dot\-product example discussed in the previous sections. for 300 iterations of the dot\-product example discussed in the previous
sections.
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.sp .sp
@ -564,30 +788,35 @@ dot\-product example discussed in the previous sections.
Dynamic Dispatch Stall Cycles: Dynamic Dispatch Stall Cycles:
RAT \- Register unavailable: 0 RAT \- Register unavailable: 0
RCU \- Retire tokens unavailable: 0 RCU \- Retire tokens unavailable: 0
SCHEDQ \- Scheduler full: 272 SCHEDQ \- Scheduler full: 272 (44.6%)
LQ \- Load queue full: 0 LQ \- Load queue full: 0
SQ \- Store queue full: 0 SQ \- Store queue full: 0
GROUP \- Static restrictions on the dispatch group: 0 GROUP \- Static restrictions on the dispatch group: 0
Dispatch Logic \- number of cycles where we saw N instructions dispatched: Dispatch Logic \- number of cycles where we saw N micro opcodes dispatched:
[# dispatched], [# cycles] [# dispatched], [# cycles]
0, 24 (3.9%) 0, 24 (3.9%)
1, 272 (44.6%) 1, 272 (44.6%)
2, 314 (51.5%) 2, 314 (51.5%)
Schedulers \- number of cycles where we saw N instructions issued: Schedulers \- number of cycles where we saw N micro opcodes issued:
[# issued], [# cycles] [# issued], [# cycles]
0, 7 (1.1%) 0, 7 (1.1%)
1, 306 (50.2%) 1, 306 (50.2%)
2, 297 (48.7%) 2, 297 (48.7%)
Scheduler\(aqs queue usage: Scheduler\(aqs queue usage:
JALU01, 0/20 [1] Resource name.
JFPU01, 18/18 [2] Average number of used buffer entries.
JLSAGU, 0/12 [3] Maximum number of used buffer entries.
[4] Total number of buffer entries.
[1] [2] [3] [4]
JALU01 0 0 20
JFPU01 17 18 18
JLSAGU 0 0 12
Retire Control Unit \- number of cycles where we saw N instructions retired: Retire Control Unit \- number of cycles where we saw N instructions retired:
@ -596,6 +825,10 @@ Retire Control Unit \- number of cycles where we saw N instructions retired:
1, 102 (16.7%) 1, 102 (16.7%)
2, 399 (65.4%) 2, 399 (65.4%)
Total ROB Entries: 64
Max Used ROB Entries: 35 ( 54.7% )
Average Used ROB Entries per cy: 32 ( 50.0% )
Register File statistics: Register File statistics:
Total number of mappings created: 900 Total number of mappings created: 900
@ -617,23 +850,21 @@ Max number of mappings used: 35
.sp .sp
If we look at the \fIDynamic Dispatch Stall Cycles\fP table, we see the counter for If we look at the \fIDynamic Dispatch Stall Cycles\fP table, we see the counter for
SCHEDQ reports 272 cycles. This counter is incremented every time the dispatch SCHEDQ reports 272 cycles. This counter is incremented every time the dispatch
logic is unable to dispatch a group of two instructions because the scheduler\(aqs logic is unable to dispatch a full group because the scheduler\(aqs queue is full.
queue is full.
.sp .sp
Looking at the \fIDispatch Logic\fP table, we see that the pipeline was only able Looking at the \fIDispatch Logic\fP table, we see that the pipeline was only able to
to dispatch two instructions 51.5% of the time. The dispatch group was limited dispatch two micro opcodes 51.5% of the time. The dispatch group was limited to
to one instruction 44.6% of the cycles, which corresponds to 272 cycles. The one micro opcode 44.6% of the cycles, which corresponds to 272 cycles. The
dispatch statistics are displayed by either using the command option dispatch statistics are displayed by either using the command option
\fB\-all\-stats\fP or \fB\-dispatch\-stats\fP\&. \fB\-all\-stats\fP or \fB\-dispatch\-stats\fP\&.
.sp .sp
The next table, \fISchedulers\fP, presents a histogram displaying a count, The next table, \fISchedulers\fP, presents a histogram displaying a count,
representing the number of instructions issued on some number of cycles. In representing the number of micro opcodes issued on some number of cycles. In
this case, of the 610 simulated cycles, single this case, of the 610 simulated cycles, single opcodes were issued 306 times
instructions were issued 306 times (50.2%) and there were 7 cycles where (50.2%) and there were 7 cycles where no opcodes were issued.
no instructions were issued.
.sp .sp
The \fIScheduler\(aqs queue usage\fP table shows that the maximum number of buffer The \fIScheduler\(aqs queue usage\fP table shows that the average and maximum number of
entries (i.e., scheduler queue entries) used at runtime. Resource JFPU01 buffer entries (i.e., scheduler queue entries) used at runtime. Resource JFPU01
reached its maximum (18 of 18 queue entries). Note that AMD Jaguar implements reached its maximum (18 of 18 queue entries). Note that AMD Jaguar implements
three schedulers: three schedulers:
.INDENT 0.0 .INDENT 0.0
@ -653,36 +884,36 @@ A full scheduler queue is either caused by data dependency chains or by a
sub\-optimal usage of hardware resources. Sometimes, resource pressure can be sub\-optimal usage of hardware resources. Sometimes, resource pressure can be
mitigated by rewriting the kernel using different instructions that consume mitigated by rewriting the kernel using different instructions that consume
different scheduler resources. Schedulers with a small queue are less resilient different scheduler resources. Schedulers with a small queue are less resilient
to bottlenecks caused by the presence of long data dependencies. to bottlenecks caused by the presence of long data dependencies. The scheduler
The scheduler statistics are displayed by statistics are displayed by using the command option \fB\-all\-stats\fP or
using the command option \fB\-all\-stats\fP or \fB\-scheduler\-stats\fP\&. \fB\-scheduler\-stats\fP\&.
.sp .sp
The next table, \fIRetire Control Unit\fP, presents a histogram displaying a count, The next table, \fIRetire Control Unit\fP, presents a histogram displaying a count,
representing the number of instructions retired on some number of cycles. In representing the number of instructions retired on some number of cycles. In
this case, of the 610 simulated cycles, two instructions were retired during this case, of the 610 simulated cycles, two instructions were retired during the
the same cycle 399 times (65.4%) and there were 109 cycles where no same cycle 399 times (65.4%) and there were 109 cycles where no instructions
instructions were retired. The retire statistics are displayed by using the were retired. The retire statistics are displayed by using the command option
command option \fB\-all\-stats\fP or \fB\-retire\-stats\fP\&. \fB\-all\-stats\fP or \fB\-retire\-stats\fP\&.
.sp .sp
The last table presented is \fIRegister File statistics\fP\&. Each physical register The last table presented is \fIRegister File statistics\fP\&. Each physical register
file (PRF) used by the pipeline is presented in this table. In the case of AMD file (PRF) used by the pipeline is presented in this table. In the case of AMD
Jaguar, there are two register files, one for floating\-point registers Jaguar, there are two register files, one for floating\-point registers (JFpuPRF)
(JFpuPRF) and one for integer registers (JIntegerPRF). The table shows that of and one for integer registers (JIntegerPRF). The table shows that of the 900
the 900 instructions processed, there were 900 mappings created. Since this instructions processed, there were 900 mappings created. Since this dot\-product
dot\-product example utilized only floating point registers, the JFPuPRF was example utilized only floating point registers, the JFPuPRF was responsible for
responsible for creating the 900 mappings. However, we see that the pipeline creating the 900 mappings. However, we see that the pipeline only used a
only used a maximum of 35 of 72 available register slots at any given time. We maximum of 35 of 72 available register slots at any given time. We can conclude
can conclude that the floating point PRF was the only register file used for that the floating point PRF was the only register file used for the example, and
the example, and that it was never resource constrained. The register file that it was never resource constrained. The register file statistics are
statistics are displayed by using the command option \fB\-all\-stats\fP or displayed by using the command option \fB\-all\-stats\fP or
\fB\-register\-file\-stats\fP\&. \fB\-register\-file\-stats\fP\&.
.sp .sp
In this example, we can conclude that the IPC is mostly limited by data In this example, we can conclude that the IPC is mostly limited by data
dependencies, and not by resource pressure. dependencies, and not by resource pressure.
.SS Instruction Flow .SS Instruction Flow
.sp .sp
This section describes the instruction flow through MCA\(aqs default out\-of\-order This section describes the instruction flow through the default pipeline of
pipeline, as well as the functional units involved in the process. \fBllvm\-mca\fP, as well as the functional units involved in the process.
.sp .sp
The default pipeline implements the following sequence of stages used to The default pipeline implements the following sequence of stages used to
process instructions. process instructions.
@ -699,9 +930,9 @@ Retire (Instruction is retired; writes are architecturally committed).
.sp .sp
The default pipeline only models the out\-of\-order portion of a processor. The default pipeline only models the out\-of\-order portion of a processor.
Therefore, the instruction fetch and decode stages are not modeled. Performance Therefore, the instruction fetch and decode stages are not modeled. Performance
bottlenecks in the frontend are not diagnosed. MCA assumes that instructions bottlenecks in the frontend are not diagnosed. \fBllvm\-mca\fP assumes that
have all been decoded and placed into a queue. Also, MCA does not model branch instructions have all been decoded and placed into a queue before the simulation
prediction. start. Also, \fBllvm\-mca\fP does not model branch prediction.
.SS Instruction Dispatch .SS Instruction Dispatch
.sp .sp
During the dispatch stage, instructions are picked in program order from a During the dispatch stage, instructions are picked in program order from a
@ -725,19 +956,19 @@ The schedulers are not full.
.UNINDENT .UNINDENT
.sp .sp
Scheduling models can optionally specify which register files are available on Scheduling models can optionally specify which register files are available on
the processor. MCA uses that information to initialize register file the processor. \fBllvm\-mca\fP uses that information to initialize register
descriptors. Users can limit the number of physical registers that are file descriptors. Users can limit the number of physical registers that are
globally available for register renaming by using the command option globally available for register renaming by using the command option
\fB\-register\-file\-size\fP\&. A value of zero for this option means \fIunbounded\fP\&. \fB\-register\-file\-size\fP\&. A value of zero for this option means \fIunbounded\fP\&. By
By knowing how many registers are available for renaming, MCA can predict knowing how many registers are available for renaming, the tool can predict
dispatch stalls caused by the lack of registers. dispatch stalls caused by the lack of physical registers.
.sp .sp
The number of reorder buffer entries consumed by an instruction depends on the The number of reorder buffer entries consumed by an instruction depends on the
number of micro\-opcodes specified by the target scheduling model. MCA\(aqs number of micro\-opcodes specified for that instruction by the target scheduling
reorder buffer\(aqs purpose is to track the progress of instructions that are model. The reorder buffer is responsible for tracking the progress of
"in\-flight," and to retire instructions in program order. The number of instructions that are "in\-flight", and retiring them in program order. The
entries in the reorder buffer defaults to the \fIMicroOpBufferSize\fP provided by number of entries in the reorder buffer defaults to the value specified by field
the target scheduling model. \fIMicroOpBufferSize\fP in the target scheduling model.
.sp .sp
Instructions that are dispatched to the schedulers consume scheduler buffer Instructions that are dispatched to the schedulers consume scheduler buffer
entries. \fBllvm\-mca\fP queries the scheduling model to determine the set entries. \fBllvm\-mca\fP queries the scheduling model to determine the set
@ -763,35 +994,35 @@ available units from the group; by default, the resource manager uses a
round\-robin selector to guarantee that resource usage is uniformly distributed round\-robin selector to guarantee that resource usage is uniformly distributed
between all units of a group. between all units of a group.
.sp .sp
\fBllvm\-mca\fP\(aqs scheduler implements three instruction queues: \fBllvm\-mca\fP\(aqs scheduler internally groups instructions into three sets:
.INDENT 0.0 .INDENT 0.0
.IP \(bu 2 .IP \(bu 2
WaitQueue: a queue of instructions whose operands are not ready. WaitSet: a set of instructions whose operands are not ready.
.IP \(bu 2 .IP \(bu 2
ReadyQueue: a queue of instructions ready to execute. ReadySet: a set of instructions ready to execute.
.IP \(bu 2 .IP \(bu 2
IssuedQueue: a queue of instructions executing. IssuedSet: a set of instructions executing.
.UNINDENT .UNINDENT
.sp .sp
Depending on the operand availability, instructions that are dispatched to the Depending on the operands availability, instructions that are dispatched to the
scheduler are either placed into the WaitQueue or into the ReadyQueue. scheduler are either placed into the WaitSet or into the ReadySet.
.sp .sp
Every cycle, the scheduler checks if instructions can be moved from the Every cycle, the scheduler checks if instructions can be moved from the WaitSet
WaitQueue to the ReadyQueue, and if instructions from the ReadyQueue can be to the ReadySet, and if instructions from the ReadySet can be issued to the
issued to the underlying pipelines. The algorithm prioritizes older instructions underlying pipelines. The algorithm prioritizes older instructions over younger
over younger instructions. instructions.
.SS Write\-Back and Retire Stage .SS Write\-Back and Retire Stage
.sp .sp
Issued instructions are moved from the ReadyQueue to the IssuedQueue. There, Issued instructions are moved from the ReadySet to the IssuedSet. There,
instructions wait until they reach the write\-back stage. At that point, they instructions wait until they reach the write\-back stage. At that point, they
get removed from the queue and the retire control unit is notified. get removed from the queue and the retire control unit is notified.
.sp .sp
When instructions are executed, the retire control unit flags the When instructions are executed, the retire control unit flags the instruction as
instruction as "ready to retire." "ready to retire."
.sp .sp
Instructions are retired in program order. The register file is notified of Instructions are retired in program order. The register file is notified of the
the retirement so that it can free the physical registers that were allocated retirement so that it can free the physical registers that were allocated for
for the instruction during the register renaming stage. the instruction during the register renaming stage.
.SS Load/Store Unit and Memory Consistency Model .SS Load/Store Unit and Memory Consistency Model
.sp .sp
To simulate an out\-of\-order execution of memory operations, \fBllvm\-mca\fP To simulate an out\-of\-order execution of memory operations, \fBllvm\-mca\fP
@ -879,8 +1110,8 @@ A load may not pass a previous store unless \fB\-noalias\fP is set.
A load has to wait until an older load barrier is fully executed. A load has to wait until an older load barrier is fully executed.
.UNINDENT .UNINDENT
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-NM" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-NM" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-nm \- list LLVM bitcode and object file's symbol table llvm-nm \- list LLVM bitcode and object file's symbol table
. .
@ -36,73 +36,157 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
\fBllvm\-nm\fP [\fIoptions\fP] [\fIfilenames...\fP] \fBllvm\-nm\fP [\fIoptions\fP] [\fIfilenames...\fP]
.SH DESCRIPTION .SH DESCRIPTION
.sp .sp
The \fBllvm\-nm\fP utility lists the names of symbols from the LLVM bitcode The \fBllvm\-nm\fP utility lists the names of symbols from LLVM bitcode
files, object files, or \fBar\fP archives containing them, named on the files, object files, and archives. Each symbol is listed along with some simple
command line. Each symbol is listed along with some simple information about information about its provenance. If no filename is specified, \fIa.out\fP is used
its provenance. If no file name is specified, or \fI\-\fP is used as a file name, as the input. If \fI\-\fP is used as a filename, \fBllvm\-nm\fP will read a file
\fBllvm\-nm\fP will process a file on its standard input stream. from its standard input stream.
.sp .sp
\fBllvm\-nm\fP\(aqs default output format is the traditional BSD \fBnm\fP \fBllvm\-nm\fP\(aqs default output format is the traditional BSD \fBnm\fP
output format. Each such output record consists of an (optional) 8\-digit output format. Each such output record consists of an (optional) 8\-digit
hexadecimal address, followed by a type code character, followed by a name, for hexadecimal address, followed by a type code character, followed by a name, for
each symbol. One record is printed per line; fields are separated by spaces. each symbol. One record is printed per line; fields are separated by spaces.
When the address is omitted, it is replaced by 8 spaces. When the address is omitted, it is replaced by 8 spaces.
.sp .sp
Type code characters currently supported, and their meanings, are as follows: The supported type code characters are as follows. Where both lower and
upper\-case characters are listed for the same meaning, a lower\-case character
represents a local symbol, whilst an upper\-case character represents a global
(external) symbol:
.sp .sp
U a, A
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Named object is referenced but undefined in this bitcode file Absolute symbol.
.UNINDENT
.UNINDENT
.sp
b, B
.INDENT 0.0
.INDENT 3.5
Uninitialized data (bss) object.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
C C
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Common (multiple definitions link together into one def) Common symbol. Multiple definitions link together into one definition.
.UNINDENT
.UNINDENT
.sp
d, D
.INDENT 0.0
.INDENT 3.5
Writable data object.
.UNINDENT
.UNINDENT
.sp
i, I
.INDENT 0.0
.INDENT 3.5
COFF: .idata symbol or symbol in a section with IMAGE_SCN_LNK_INFO set.
.UNINDENT
.UNINDENT
.sp
n
.INDENT 0.0
.INDENT 3.5
ELF: local symbol from non\-alloc section.
.sp
COFF: debug symbol.
.UNINDENT
.UNINDENT
.sp
N
.INDENT 0.0
.INDENT 3.5
ELF: debug section symbol, or global symbol from non\-alloc section.
.UNINDENT
.UNINDENT
.sp
s, S
.INDENT 0.0
.INDENT 3.5
COFF: section symbol.
.sp
Mach\-O: absolute symbol or symbol from a section other than __TEXT_EXEC __text,
__TEXT __text, __DATA __data, or __DATA __bss.
.UNINDENT
.UNINDENT
.sp
r, R
.INDENT 0.0
.INDENT 3.5
Read\-only data object.
.UNINDENT
.UNINDENT
.sp
t, T
.INDENT 0.0
.INDENT 3.5
Code (text) object.
.UNINDENT
.UNINDENT
.sp
u
.INDENT 0.0
.INDENT 3.5
ELF: GNU unique symbol.
.UNINDENT
.UNINDENT
.sp
U
.INDENT 0.0
.INDENT 3.5
Named object is undefined in this file.
.UNINDENT
.UNINDENT
.sp
v
.INDENT 0.0
.INDENT 3.5
ELF: Undefined weak object. It is not a link failure if the object is not
defined.
.UNINDENT
.UNINDENT
.sp
V
.INDENT 0.0
.INDENT 3.5
ELF: Defined weak object symbol. This definition will only be used if no
regular definitions exist in a link. If multiple weak definitions and no
regular definitions exist, one of the weak definitions will be used.
.UNINDENT
.UNINDENT
.sp
w
.INDENT 0.0
.INDENT 3.5
Undefined weak symbol other than an ELF object symbol. It is not a link failure
if the symbol is not defined.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
W W
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Weak reference (multiple definitions link together into zero or one definitions) Defined weak symbol other than an ELF object symbol. This definition will only
be used if no regular definitions exist in a link. If multiple weak definitions
and no regular definitions exist, one of the weak definitions will be used.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
t \-
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Local function (text) object Mach\-O: N_STAB symbol.
.UNINDENT
.UNINDENT
.sp
T
.INDENT 0.0
.INDENT 3.5
Global function (text) object
.UNINDENT
.UNINDENT
.sp
d
.INDENT 0.0
.INDENT 3.5
Local data object
.UNINDENT
.UNINDENT
.sp
D
.INDENT 0.0
.INDENT 3.5
Global data object
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
? ?
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
Something unrecognizable Something unrecognizable.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
@ -114,25 +198,23 @@ file.
.SH OPTIONS .SH OPTIONS
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-B (default) .B \-B
Use BSD output format. Alias for \fI\-\-format=bsd\fP\&. Use BSD output format. Alias for \fB\-\-format=bsd\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-P
Use POSIX.2 output format. Alias for \fI\-\-format=posix\fP\&.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-debug\-syms, \-a .B \-\-debug\-syms, \-a
Show all symbols, even debugger only. Show all symbols, even those usually suppressed.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-defined\-only .B \-\-defined\-only, \-U
Print only symbols defined in this file (as opposed to Print only symbols defined in this file.
symbols which may be referenced by objects in this file, but not .UNINDENT
defined in this file.) .INDENT 0.0
.TP
.B \-\-demangle, \-C
Demangle symbol names.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -142,29 +224,54 @@ Display dynamic symbols instead of normal symbols.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-extern\-only, \-g .B \-\-extern\-only, \-g
Print only symbols whose definitions are external; that is, accessible Print only symbols whose definitions are external; that is, accessible from
from other files. other files.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-no\-weak, \-W .B \-\-format=<format>, \-f
Don\(aqt print any weak symbols in the output. Select an output format; \fIformat\fP may be \fIsysv\fP, \fIposix\fP, \fIdarwin\fP, or \fIbsd\fP\&.
The default is \fIbsd\fP\&.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-format=format, \-f format .B \-\-help, \-h
Select an output format; \fIformat\fP may be \fIsysv\fP, \fIposix\fP, or \fIbsd\fP\&. The default
is \fIbsd\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-help
Print a summary of command\-line options and their meanings. Print a summary of command\-line options and their meanings.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-help\-list
Print an uncategorized summary of command\-line options and their meanings.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-just\-symbol\-name, \-j
Print just the symbol names.
.UNINDENT
.INDENT 0.0
.TP
.B \-m
Use Darwin format. Alias for \fB\-\-format=darwin\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-demangle
Don\(aqt demangle symbol names. This is the default.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-llvm\-bc
Disable the LLVM bitcode reader.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-sort, \-p .B \-\-no\-sort, \-p
Shows symbols in order encountered. Show symbols in the order encountered.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-weak, \-W
Don\(aqt print weak symbols.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -173,13 +280,34 @@ Sort symbols by address.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-portability, \-P
Use POSIX.2 output format. Alias for \fB\-\-format=posix\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-print\-armap, \-M
Print the archive symbol table, in addition to the symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-print\-file\-name, \-A, \-o .B \-\-print\-file\-name, \-A, \-o
Precede each symbol with the file it came from. Precede each symbol with the file it came from.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-print\-size, \-S .B \-\-print\-size, \-S
Show symbol size instead of address. Show symbol size as well as address (not applicable for Mach\-O).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-radix=<RADIX>, \-t
Specify the radix of the symbol address(es). Values accepted are \fId\fP (decimal),
\fIx\fP (hexadecimal) and \fIo\fP (octal).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-reverse\-sort, \-r
Sort symbols in reverse order.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -188,14 +316,61 @@ Sort symbols by size.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-undefined\-only, \-u .B \-\-special\-syms
Print only symbols referenced but not defined in this file. Ignored. For GNU compatibility only.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-radix=RADIX, \-t .B \-\-undefined\-only, \-u
Specify the radix of the symbol address(es). Values accepted d(decimal), Print only undefined symbols.
x(hexadecomal) and o(octal). .UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Display the version of the \fBllvm\-nm\fP executable. Does not stack with
other commands.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-without\-aliases
Exclude aliases from the output.
.UNINDENT
.INDENT 0.0
.TP
.B @<FILE>
Read command\-line options from response file \fI<FILE>\fP\&.
.UNINDENT
.SH MACH-O SPECIFIC OPTIONS
.INDENT 0.0
.TP
.B \-\-add\-dyldinfo
Add symbols from the dyldinfo, if they are not already in the symbol table.
This is the default.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-arch=<arch1[,arch2,...]>
Dump the symbols from the specified architecture(s).
.UNINDENT
.INDENT 0.0
.TP
.B \-\-dyldinfo\-only
Dump only symbols from the dyldinfo.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-dyldinfo
Do not add any symbols from the dyldinfo.
.UNINDENT
.INDENT 0.0
.TP
.B \-s=<segment section>
Dump only symbols from this segment and section name.
.UNINDENT
.INDENT 0.0
.TP
.B \-x
Print symbol entry in hex.
.UNINDENT .UNINDENT
.SH BUGS .SH BUGS
.INDENT 0.0 .INDENT 0.0
@ -212,10 +387,11 @@ x(hexadecomal) and o(octal).
\fBllvm\-nm\fP exits with an exit code of zero. \fBllvm\-nm\fP exits with an exit code of zero.
.SH SEE ALSO .SH SEE ALSO
.sp .sp
llvm\-dis, ar(1), nm(1) \fBllvm\-ar(1)\fP, \fBllvm\-objdump(1)\fP, \fBllvm\-readelf(1)\fP,
\fBllvm\-readobj(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,6 @@
# $FreeBSD$ # $FreeBSD$
PROG_CXX= llvm-objcopy PROG_CXX= llvm-objcopy
MAN=
SRCDIR= llvm/tools/llvm-objcopy SRCDIR= llvm/tools/llvm-objcopy
SRCS+= Buffer.cpp SRCS+= Buffer.cpp

View File

@ -0,0 +1,721 @@
.\" $FreeBSD$
.\" Man page generated from reStructuredText.
.
.TH "LLVM-OBJCOPY" "1" "2020-06-26" "10" "LLVM"
.SH NAME
llvm-objcopy \- object copying and editing tool
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBllvm\-objcopy\fP [\fIoptions\fP] \fIinput\fP [\fIoutput\fP]
.SH DESCRIPTION
.sp
\fBllvm\-objcopy\fP is a tool to copy and manipulate objects. In basic
usage, it makes a semantic copy of the input to the output. If any options are
specified, the output may be modified along the way, e.g. by removing sections.
.sp
If no output file is specified, the input file is modified in\-place. If "\-" is
specified for the input file, the input is read from the program\(aqs standard
input stream. If "\-" is specified for the output file, the output is written to
the standard output stream of the program.
.sp
If the input is an archive, any requested operations will be applied to each
archive member individually.
.sp
The tool is still in active development, but in most scenarios it works as a
drop\-in replacement for GNU\(aqs \fBobjcopy\fP\&.
.SH GENERIC AND CROSS-PLATFORM OPTIONS
.sp
The following options are either agnostic of the file format, or apply to
multiple file formats.
.INDENT 0.0
.TP
.B \-\-add\-gnu\-debuglink <debug\-file>
Add a .gnu_debuglink section for \fB<debug\-file>\fP to the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-add\-section <section=file>
Add a section named \fB<section>\fP with the contents of \fB<file>\fP to the
output. For ELF objects the section will be of type \fISHT_NOTE\fP, if the name
starts with ".note". Otherwise, it will have type \fISHT_PROGBITS\fP\&. Can be
specified multiple times to add multiple sections.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-binary\-architecture <arch>, \-B
Ignored for compatibility.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-disable\-deterministic\-archives, \-U
Use real values for UIDs, GIDs and timestamps when updating archive member
headers.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-discard\-all, \-x
Remove most local symbols from the output. Different file formats may limit
this to a subset of the local symbols. For example, file and section symbols in
ELF objects will not be discarded.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-dump\-section <section>=<file>
Dump the contents of section \fB<section>\fP into the file \fB<file>\fP\&. Can be
specified multiple times to dump multiple sections to different files.
\fB<file>\fP is unrelated to the input and output files provided to
\fBllvm\-objcopy\fP and as such the normal copying and editing
operations will still be performed. No operations are performed on the sections
prior to dumping them.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-enable\-deterministic\-archives, \-D
Enable deterministic mode when copying archives, i.e. use 0 for archive member
header UIDs, GIDs and timestamp fields. On by default.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-help, \-h
Print a summary of command line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-only\-keep\-debug
Produce a debug file as the output that only preserves contents of sections
useful for debugging purposes.
.sp
For ELF objects, this removes the contents of \fISHF_ALLOC\fP sections that are not
\fISHT_NOTE\fP by making them \fISHT_NOBITS\fP and shrinking the program headers where
possible.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-only\-section <section>, \-j
Remove all sections from the output, except for sections named \fB<section>\fP\&.
Can be specified multiple times to keep multiple sections.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-redefine\-sym <old>=<new>
Rename symbols called \fB<old>\fP to \fB<new>\fP in the output. Can be specified
multiple times to rename multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-redefine\-syms <filename>
Rename symbols in the output as described in the file \fB<filename>\fP\&. In the
file, each line represents a single symbol to rename, with the old name and new
name separated by whitespace. Leading and trailing whitespace is ignored, as is
anything following a \(aq#\(aq. Can be specified multiple times to read names from
multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-regex
If specified, symbol and section names specified by other switches are treated
as extended POSIX regular expression patterns.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-remove\-section <section>, \-R
Remove the specified section from the output. Can be specified multiple times
to remove multiple sections simultaneously.
.sp
For MachO objects, \fB<section>\fP must be formatted as
\fB<segment name>,<section name>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-set\-section\-alignment <section>=<align>
Set the alignment of section \fB<section>\fP to \fI<align>\(ga\fP\&. Can be specified
multiple times to update multiple sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-all\-gnu
Remove all symbols, debug sections and relocations from the output. This option
is equivalent to GNU \fBobjcopy\fP\(aqs \fB\-\-strip\-all\fP switch.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-all, \-S
For ELF objects, remove from the output all symbols and non\-alloc sections not
within segments, except for .gnu.warning, .ARM.attribute sections and the
section name table.
.sp
For COFF and Mach\-O objects, remove all symbols, debug sections, and
relocations from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-debug, \-g
Remove all debug sections from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-symbol <symbol>, \-N
Remove all symbols named \fB<symbol>\fP from the output. Can be specified
multiple times to remove multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-symbols <filename>
Remove all symbols whose names appear in the file \fB<filename>\fP, from the
output. In the file, each line represents a single symbol name, with leading
and trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be
specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-unneeded\-symbol <symbol>
Remove from the output all symbols named \fB<symbol>\fP that are local or
undefined and are not required by any relocation.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-unneeded\-symbols <filename>
Remove all symbols whose names appear in the file \fB<filename>\fP, from the
output, if they are local or undefined and are not required by any relocation.
In the file, each line represents a single symbol name, with leading and
trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be specified
multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-unneeded
Remove from the output all local or undefined symbols that are not required by
relocations. Also remove all debug sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version, \-V
Display the version of the \fBllvm\-objcopy\fP executable.
.UNINDENT
.INDENT 0.0
.TP
.B @<FILE>
Read command\-line options and commands from response file \fI<FILE>\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-wildcard, \-w
Allow wildcard syntax for symbol\-related flags. On by default for
section\-related flags. Incompatible with \-\-regex.
.sp
Wildcard syntax allows the following special symbols:
.TS
center;
|l|l|l|.
_
T{
Character
T} T{
Meaning
T} T{
Equivalent
T}
_
T{
\fB*\fP
T} T{
Any number of characters
T} T{
\fB\&.*\fP
T}
_
T{
\fB?\fP
T} T{
Any single character
T} T{
\fB\&.\fP
T}
_
T{
\fB\e\fP
T} T{
Escape the next character
T} T{
\fB\e\fP
T}
_
T{
\fB[a\-z]\fP
T} T{
Character class
T} T{
\fB[a\-z]\fP
T}
_
T{
\fB[!a\-z]\fP, \fB[^a\-z]\fP
T} T{
Negated character class
T} T{
\fB[^a\-z]\fP
T}
_
.TE
.sp
Additionally, starting a wildcard with \(aq!\(aq will prevent a match, even if
another flag matches. For example \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP will strip all symbols
except for \fBx\fP\&.
.sp
The order of wildcards does not matter. For example, \fB\-w \-N \(aq*\(aq \-N \(aq!x\(aq\fP is
the same as \fB\-w \-N \(aq!x\(aq \-N \(aq*\(aq\fP\&.
.UNINDENT
.SH COFF-SPECIFIC OPTIONS
.sp
The following options are implemented only for COFF objects. If used with other
objects, \fBllvm\-objcopy\fP will either emit an error or silently ignore
them.
.SH ELF-SPECIFIC OPTIONS
.sp
The following options are implemented only for ELF objects. If used with other
objects, \fBllvm\-objcopy\fP will either emit an error or silently ignore
them.
.INDENT 0.0
.TP
.B \-\-add\-symbol <name>=[<section>:]<value>[,<flags>]
Add a new symbol called \fB<name>\fP to the output symbol table, in the section
named \fB<section>\fP, with value \fB<value>\fP\&. If \fB<section>\fP is not specified,
the symbol is added as an absolute symbol. The \fB<flags>\fP affect the symbol
properties. Accepted values are:
.INDENT 7.0
.IP \(bu 2
\fIglobal\fP = the symbol will have global binding.
.IP \(bu 2
\fIlocal\fP = the symbol will have local binding.
.IP \(bu 2
\fIweak\fP = the symbol will have weak binding.
.IP \(bu 2
\fIdefault\fP = the symbol will have default visibility.
.IP \(bu 2
\fIhidden\fP = the symbol will have hidden visibility.
.IP \(bu 2
\fIprotected\fP = the symbol will have protected visibility.
.IP \(bu 2
\fIfile\fP = the symbol will be an \fISTT_FILE\fP symbol.
.IP \(bu 2
\fIsection\fP = the symbol will be an \fISTT_SECTION\fP symbol.
.IP \(bu 2
\fIobject\fP = the symbol will be an \fISTT_OBJECT\fP symbol.
.IP \(bu 2
\fIfunction\fP = the symbol will be an \fISTT_FUNC\fP symbol.
.IP \(bu 2
\fIindirect\-function\fP = the symbol will be an \fISTT_GNU_IFUNC\fP symbol.
.UNINDENT
.sp
Additionally, the following flags are accepted but ignored: \fIdebug\fP,
\fIconstructor\fP, \fIwarning\fP, \fIindirect\fP, \fIsynthetic\fP, \fIunique\-object\fP, \fIbefore\fP\&.
.sp
Can be specified multiple times to add multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-allow\-broken\-links
Allow \fBllvm\-objcopy\fP to remove sections even if it would leave invalid
section references. Any invalid sh_link fields will be set to zero.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-build\-id\-link\-dir <dir>
Set the directory used by \fI\%\-\-build\-id\-link\-input\fP and
\fI\%\-\-build\-id\-link\-output\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-build\-id\-link\-input <suffix>
Hard\-link the input to \fB<dir>/xx/xxx<suffix>\fP, where \fB<dir>\fP is the directory
specified by \fI\%\-\-build\-id\-link\-dir\fP\&. The path used is derived from the
hex build ID.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-build\-id\-link\-output <suffix>
Hard\-link the output to \fB<dir>/xx/xxx<suffix>\fP, where \fB<dir>\fP is the directory
specified by \fI\%\-\-build\-id\-link\-dir\fP\&. The path used is derived from the
hex build ID.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-change\-start <incr>, \-\-adjust\-start
Add \fB<incr>\fP to the program\(aqs start address. Can be specified multiple
times, in which case the values will be applied cumulatively.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-compress\-debug\-sections [<style>]
Compress DWARF debug sections in the output, using the specified style.
Supported styles are \fIzlib\-gnu\fP and \fIzlib\fP\&. Defaults to \fIzlib\fP if no style is
specified.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-decompress\-debug\-sections
Decompress any compressed DWARF debug sections in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-discard\-locals, \-X
Remove local symbols starting with ".L" from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-extract\-dwo
Remove all sections that are not DWARF .dwo sections from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-extract\-main\-partition
Extract the main partition from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-extract\-partition <name>
Extract the named partition from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-globalize\-symbol <symbol>
Mark any defined symbols named \fB<symbol>\fP as global symbols in the output.
Can be specified multiple times to mark multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-globalize\-symbols <filename>
Read a list of names from the file \fB<filename>\fP and mark defined symbols with
those names as global in the output. In the file, each line represents a single
symbol, with leading and trailing whitespace ignored, as is anything following
a \(aq#\(aq. Can be specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-input\-target <format>, \-I
Read the input as the specified format. See \fI\%SUPPORTED FORMATS\fP for a list of
valid \fB<format>\fP values. If unspecified, \fBllvm\-objcopy\fP will attempt
to determine the format automatically.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-file\-symbols
Keep symbols of type \fISTT_FILE\fP, even if they would otherwise be stripped.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-global\-symbol <symbol>
Make all symbols local in the output, except for symbols with the name
\fB<symbol>\fP\&. Can be specified multiple times to ignore multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-global\-symbols <filename>
Make all symbols local in the output, except for symbols named in the file
\fB<filename>\fP\&. In the file, each line represents a single symbol, with leading
and trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be
specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-section <section>
When removing sections from the output, do not remove sections named
\fB<section>\fP\&. Can be specified multiple times to keep multiple sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-symbol <symbol>, \-K
When removing symbols from the output, do not remove symbols named
\fB<symbol>\fP\&. Can be specified multiple times to keep multiple symbols.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-keep\-symbols <filename>
When removing symbols from the output do not remove symbols named in the file
\fB<filename>\fP\&. In the file, each line represents a single symbol, with leading
and trailing whitespace ignored, as is anything following a \(aq#\(aq. Can be
specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-localize\-hidden
Make all symbols with hidden or internal visibility local in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-localize\-symbol <symbol>, \-L
Mark any defined non\-common symbol named \fB<symbol>\fP as a local symbol in the
output. Can be specified multiple times to mark multiple symbols as local.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-localize\-symbols <filename>
Read a list of names from the file \fB<filename>\fP and mark defined non\-common
symbols with those names as local in the output. In the file, each line
represents a single symbol, with leading and trailing whitespace ignored, as is
anything following a \(aq#\(aq. Can be specified multiple times to read names from
multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-new\-symbol\-visibility <visibility>
Specify the visibility of the symbols automatically created when using binary
input or \fI\%\-\-add\-symbol\fP\&. Valid options are:
.INDENT 7.0
.IP \(bu 2
\fIdefault\fP
.IP \(bu 2
\fIhidden\fP
.IP \(bu 2
\fIinternal\fP
.IP \(bu 2
\fIprotected\fP
.UNINDENT
.sp
The default is \fIdefault\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-output\-target <format>, \-O
Write the output as the specified format. See \fI\%SUPPORTED FORMATS\fP for a list
of valid \fB<format>\fP values. If unspecified, the output format is assumed to
be the same as the input file\(aqs format.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-prefix\-alloc\-sections <prefix>
Add \fB<prefix>\fP to the front of the names of all allocatable sections in the
output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-prefix\-symbols <prefix>
Add \fB<prefix>\fP to the front of every symbol name in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-preserve\-dates, \-p
Preserve access and modification timestamps in the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-rename\-section <old>=<new>[,<flag>,...]
Rename sections called \fB<old>\fP to \fB<new>\fP in the output, and apply any
specified \fB<flag>\fP values. See \fI\%\-\-set\-section\-flags\fP for a list of
supported flags. Can be specified multiple times to rename multiple sections.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-set\-section\-flags <section>=<flag>[,<flag>,...]
Set section properties in the output of section \fB<section>\fP based on the
specified \fB<flag>\fP values. Can be specified multiple times to update multiple
sections.
.sp
Following is a list of supported flags and their effects:
.INDENT 7.0
.IP \(bu 2
\fIalloc\fP = add the \fISHF_ALLOC\fP flag.
.IP \(bu 2
\fIload\fP = if the section has \fISHT_NOBITS\fP type, mark it as a \fISHT_PROGBITS\fP
section.
.IP \(bu 2
\fIreadonly\fP = if this flag is not specified, add the \fISHF_WRITE\fP flag.
.IP \(bu 2
\fIcode\fP = add the \fISHF_EXECINSTR\fP flag.
.IP \(bu 2
\fImerge\fP = add the \fISHF_MERGE\fP flag.
.IP \(bu 2
\fIstrings\fP = add the \fISHF_STRINGS\fP flag.
.IP \(bu 2
\fIcontents\fP = if the section has \fISHT_NOBITS\fP type, mark it as a \fISHT_PROGBITS\fP
section.
.UNINDENT
.sp
The following flags are also accepted, but are ignored for GNU compatibility:
\fInoload\fP, \fIdebug\fP, \fIdata\fP, \fIrom\fP, \fIshare\fP\&.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-set\-start\-addr <addr>
Set the start address of the output to \fB<addr>\fP\&. Overrides any previously
specified \fI\%\-\-change\-start\fP or \fI\%\-\-adjust\-start\fP options.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-split\-dwo <dwo\-file>
Equivalent to running \fBllvm\-objcopy\fP with \fI\%\-\-extract\-dwo\fP and
\fB<dwo\-file>\fP as the output file and no other options, and then with
\fI\%\-\-strip\-dwo\fP on the input file.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-dwo
Remove all DWARF .dwo sections from the output.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-non\-alloc
Remove from the output all non\-allocatable sections that are not within
segments.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-strip\-sections
Remove from the output all section headers and all section data not within
segments. Note that many tools will not be able to use an object without
section headers.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-target <format>, \-F
Equivalent to \fI\%\-\-input\-target\fP and \fI\%\-\-output\-target\fP for the
specified format. See \fI\%SUPPORTED FORMATS\fP for a list of valid \fB<format>\fP
values.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-weaken\-symbol <symbol>, \-W
Mark any global symbol named \fB<symbol>\fP as a weak symbol in the output. Can
be specified multiple times to mark multiple symbols as weak.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-weaken\-symbols <filename>
Read a list of names from the file \fB<filename>\fP and mark global symbols with
those names as weak in the output. In the file, each line represents a single
symbol, with leading and trailing whitespace ignored, as is anything following
a \(aq#\(aq. Can be specified multiple times to read names from multiple files.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-weaken
Mark all defined global symbols as weak in the output.
.UNINDENT
.SH SUPPORTED FORMATS
.sp
The following values are currently supported by \fBllvm\-objcopy\fP for the
\fI\%\-\-input\-target\fP, \fI\%\-\-output\-target\fP, and \fI\%\-\-target\fP
options. For GNU \fBobjcopy\fP compatibility, the values are all bfdnames.
.INDENT 0.0
.IP \(bu 2
\fIbinary\fP
.IP \(bu 2
\fIihex\fP
.IP \(bu 2
\fIelf32\-i386\fP
.IP \(bu 2
\fIelf32\-x86\-64\fP
.IP \(bu 2
\fIelf64\-x86\-64\fP
.IP \(bu 2
\fIelf32\-iamcu\fP
.IP \(bu 2
\fIelf32\-littlearm\fP
.IP \(bu 2
\fIelf64\-aarch64\fP
.IP \(bu 2
\fIelf64\-littleaarch64\fP
.IP \(bu 2
\fIelf32\-littleriscv\fP
.IP \(bu 2
\fIelf64\-littleriscv\fP
.IP \(bu 2
\fIelf32\-powerpc\fP
.IP \(bu 2
\fIelf32\-powerpcle\fP
.IP \(bu 2
\fIelf64\-powerpc\fP
.IP \(bu 2
\fIelf64\-powerpcle\fP
.IP \(bu 2
\fIelf32\-bigmips\fP
.IP \(bu 2
\fIelf32\-ntradbigmips\fP
.IP \(bu 2
\fIelf32\-ntradlittlemips\fP
.IP \(bu 2
\fIelf32\-tradbigmips\fP
.IP \(bu 2
\fIelf32\-tradlittlemips\fP
.IP \(bu 2
\fIelf64\-tradbigmips\fP
.IP \(bu 2
\fIelf64\-tradlittlemips\fP
.IP \(bu 2
\fIelf32\-sparc\fP
.IP \(bu 2
\fIelf32\-sparcel\fP
.UNINDENT
.sp
Additionally, all targets except \fIbinary\fP and \fIihex\fP can have \fI\-freebsd\fP as a
suffix.
.SH BINARY INPUT AND OUTPUT
.sp
If \fIbinary\fP is used as the value for \fI\%\-\-input\-target\fP, the input file
will be embedded as a data section in an ELF relocatable object, with symbols
\fB_binary_<file_name>_start\fP, \fB_binary_<file_name>_end\fP, and
\fB_binary_<file_name>_size\fP representing the start, end and size of the data,
where \fB<file_name>\fP is the path of the input file as specified on the command
line with non\-alphanumeric characters converted to \fB_\fP\&.
.sp
If \fIbinary\fP is used as the value for \fI\%\-\-output\-target\fP, the output file
will be a raw binary file, containing the memory image of the input file.
Symbols and relocation information will be discarded. The image will start at
the address of the first loadable section in the output.
.SH EXIT STATUS
.sp
\fBllvm\-objcopy\fP exits with a non\-zero exit code if there is an error.
Otherwise, it exits with code 0.
.SH BUGS
.sp
To report bugs, please visit <\fI\%http://llvm.org/bugs/\fP>.
.sp
There is a known issue with \fI\%\-\-input\-target\fP and \fI\%\-\-target\fP
causing only \fBbinary\fP and \fBihex\fP formats to have any effect. Other values
will be ignored and \fBllvm\-objcopy\fP will attempt to guess the input
format.
.SH SEE ALSO
.sp
\fBllvm\-strip(1)\fP
.SH AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT
2003-2020, LLVM Project
.\" Generated by docutils manpage writer.
.

View File

@ -1,7 +1,8 @@
.\" This file is distributed under the University of Illinois Open Source .\" Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
.\" License. .\" See https://llvm.org/LICENSE.txt for license information.
.\" SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
.\" .\"
.Dd November 27, 2018 .Dd December 19, 2018
.Dt LLVM-OBJDUMP 1 .Dt LLVM-OBJDUMP 1
.Os .Os
.Sh NAME .Sh NAME

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-PDBUTIL" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-PDBUTIL" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-pdbutil \- PDB File forensics and diagnostics llvm-pdbutil \- PDB File forensics and diagnostics
. .
@ -738,8 +738,8 @@ Merge two PDB files into a single file.
.sp .sp
Write the resulting PDB to the specified file. Write the resulting PDB to the specified file.
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-PROFDATA" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-PROFDATA" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-profdata \- Profile data tool llvm-profdata \- Profile data tool
. .
@ -44,6 +44,8 @@ data files.
\fI\%merge\fP \fI\%merge\fP
.IP \(bu 2 .IP \(bu 2
\fI\%show\fP \fI\%show\fP
.IP \(bu 2
\fI\%overlap\fP
.UNINDENT .UNINDENT
.SH MERGE .SH MERGE
.SS SYNOPSIS .SS SYNOPSIS
@ -94,6 +96,17 @@ be of the form <filename> or <weight>,<filename>.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-remapping\-file=path, \-r=path
Specify a file which contains a remapping from symbol names in the input
profile to the symbol names that should be used in the output profile. The
file should consist of lines of the form \fB<input\-symbol> <output\-symbol>\fP\&.
Blank lines and lines starting with \fB#\fP are skipped.
.sp
The llvm\-cxxmap tool can be used to generate the symbol
remapping file.
.UNINDENT
.INDENT 0.0
.TP
.B \-instr (default) .B \-instr (default)
Specify that the input profile is an instrumentation\-based profile. Specify that the input profile is an instrumentation\-based profile.
.UNINDENT .UNINDENT
@ -139,6 +152,15 @@ optimization during PGO.
Use N threads to perform profile merging. When N=0, llvm\-profdata auto\-detects Use N threads to perform profile merging. When N=0, llvm\-profdata auto\-detects
an appropriate number of threads to use. This is the default. an appropriate number of threads to use. This is the default.
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B \-failure\-mode=[any|all]
Set the failure mode. There are two options: \(aqany\(aq causes the merge command to
fail if any profiles are invalid, and \(aqall\(aq causes the merge command to fail
only if all profiles are invalid. If \(aqall\(aq is set, information from any
invalid profiles is excluded from the final merged product. The default
failure mode is \(aqany\(aq.
.UNINDENT
.SS EXAMPLES .SS EXAMPLES
.SS Basic Usage .SS Basic Usage
.sp .sp
@ -247,13 +269,89 @@ Specify that the input profile is a sample\-based profile.
.B \-memop\-sizes .B \-memop\-sizes
Show the profiled sizes of the memory intrinsic calls for shown functions. Show the profiled sizes of the memory intrinsic calls for shown functions.
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B \-value\-cutoff=n
Show only those functions whose max count values are greater or equal to \fBn\fP\&.
By default, the value\-cutoff is set to 0.
.UNINDENT
.INDENT 0.0
.TP
.B \-list\-below\-cutoff
Only output names of functions whose max count value are below the cutoff
value.
.UNINDENT
.INDENT 0.0
.TP
.B \-showcs
Only show context sensitive profile counts. The default is to filter all
context sensitive profile counts.
.UNINDENT
.SH OVERLAP
.SS SYNOPSIS
.sp
\fBllvm\-profdata overlap\fP [\fIoptions\fP] [\fIbase profile file\fP] [\fItest profile file\fP]
.SS DESCRIPTION
.sp
\fBllvm\-profdata overlap\fP takes two profile data files and displays the
\fIoverlap\fP of counter distribution between the whole files and between any of the
specified functions.
.sp
In this command, \fIoverlap\fP is defined as follows:
Suppose \fIbase profile file\fP has the following counts:
{c1_1, c1_2, ..., c1_n, c1_u_1, c2_u_2, ..., c2_u_s},
and \fItest profile file\fP has
{c2_1, c2_2, ..., c2_n, c2_v_1, c2_v_2, ..., c2_v_t}.
Here c{1|2}_i (i = 1 .. n) are matched counters and c1_u_i (i = 1 .. s) and
c2_v_i (i = 1 .. v) are unmatched counters (or counters only existing in)
\fIbase profile file\fP and \fItest profile file\fP, respectively.
Let sum_1 = c1_1 + c1_2 + ... + c1_n + c1_u_1 + c2_u_2 + ... + c2_u_s, and
sum_2 = c2_1 + c2_2 + ... + c2_n + c2_v_1 + c2_v_2 + ... + c2_v_t.
\fIoverlap\fP = min(c1_1/sum_1, c2_1/sum_2) + min(c1_2/sum_1, c2_2/sum_2) + ...
+ min(c1_n/sum_1, c2_n/sum_2).
.sp
The result overlap distribution is a percentage number, ranging from 0.0% to
100.0%, where 0.0% means there is no overlap and 100.0% means a perfect
overlap.
.sp
Here is an example, if \fIbase profile file\fP has counts of {400, 600}, and
\fItest profile file\fP has matched counts of {60000, 40000}. The \fIoverlap\fP is 80%.
.SS OPTIONS
.INDENT 0.0
.TP
.B \-function=string
Print details for a function if the function\(aqs name contains the given string.
.UNINDENT
.INDENT 0.0
.TP
.B \-help
Print a summary of command line options.
.UNINDENT
.INDENT 0.0
.TP
.B \-o=output or \-o output
Specify the output file name. If \fIoutput\fP is \fB\-\fP or it isn\(aqt specified,
then the output is sent to standard output.
.UNINDENT
.INDENT 0.0
.TP
.B \-value\-cutoff=n
Show only those functions whose max count values are greater or equal to \fBn\fP\&.
By default, the value\-cutoff is set to max of unsigned long long.
.UNINDENT
.INDENT 0.0
.TP
.B \-cs
Only show overlap for the context sensitive profile counts. The default is to show
non\-context sensitive profile counts.
.UNINDENT
.SH EXIT STATUS .SH EXIT STATUS
.sp .sp
\fBllvm\-profdata\fP returns 1 if the command is omitted or is invalid, \fBllvm\-profdata\fP 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. if it cannot read input files, or if there is a mismatch between their data.
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,10 +1,13 @@
# $FreeBSD$ # $FreeBSD$
PROG_CXX= llvm-symbolizer PROG_CXX= llvm-symbolizer
MAN= llvm-symbolizer.1 llvm-addr2line.1
SRCDIR= llvm/tools/llvm-symbolizer SRCDIR= llvm/tools/llvm-symbolizer
SRCS+= llvm-symbolizer.cpp SRCS+= llvm-symbolizer.cpp
LIBADD+= z LIBADD+= z
LINKS+= ${BINDIR}/llvm-symbolizer ${BINDIR}/llvm-addr2line
.include "../llvm.prog.mk" .include "../llvm.prog.mk"

View File

@ -0,0 +1,66 @@
.\" $FreeBSD$
.\" Man page generated from reStructuredText.
.
.TH "LLVM-ADDR2LINE" "1" "2020-06-26" "10" "LLVM"
.SH NAME
llvm-addr2line \- a drop-in replacement for addr2line
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBllvm\-addr2line\fP [\fIoptions\fP]
.SH DESCRIPTION
.sp
\fBllvm\-addr2line\fP is an alias for the \fBllvm\-symbolizer(1)\fP
tool with different defaults. The goal is to make it a drop\-in replacement for
GNU\(aqs \fBaddr2line\fP\&.
.sp
Here are some of those differences:
.INDENT 0.0
.IP \(bu 2
Defaults not to print function names. Use \fI\%\-f\fP to enable that.
.IP \(bu 2
Defaults not to demangle function names. Use \fI\%\-C\fP to switch the
demangling on.
.IP \(bu 2
Defaults not to print inlined frames. Use \fI\%\-i\fP to show inlined
frames for a source code location in an inlined function.
.IP \(bu 2
Uses \fI\%\-\-output\-style=GNU\fP by default.
.IP \(bu 2
Parses options from the environment variable \fBLLVM_ADDR2LINE_OPTS\fP\&.
.UNINDENT
.SH SEE ALSO
.sp
\fBllvm\-symbolizer(1)\fP
.SH AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT
2003-2020, LLVM Project
.\" Generated by docutils manpage writer.
.

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "LLVM-SYMBOLIZER" "1" "2018-08-02" "7" "LLVM" .TH "LLVM-SYMBOLIZER" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
llvm-symbolizer \- convert addresses into source code locations llvm-symbolizer \- convert addresses into source code locations
. .
@ -33,64 +33,180 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.. ..
.SH SYNOPSIS .SH SYNOPSIS
.sp .sp
\fBllvm\-symbolizer\fP [options] \fBllvm\-symbolizer\fP [\fIoptions\fP] [\fIaddresses...\fP]
.SH DESCRIPTION .SH DESCRIPTION
.sp .sp
\fBllvm\-symbolizer\fP reads object file names and addresses from standard \fBllvm\-symbolizer\fP reads object file names and addresses from the
input and prints corresponding source code locations to standard output. command\-line and prints corresponding source code locations to standard output.
If object file is specified in command line, \fBllvm\-symbolizer\fP .sp
processes only addresses from standard input, the rest is output verbatim. If no address is specified on the command\-line, it reads the addresses from
This program uses debug info sections and symbol table in the object files. standard input. If no object file is specified on the command\-line, but
.SH EXAMPLE addresses are, or if at any time an input value is not recognized, the input is
simply echoed to the output.
.sp
A positional argument or standard input value can be preceded by "DATA" or
"CODE" to indicate that the address should be symbolized as data or executable
code respectively. If neither is specified, "CODE" is assumed. DATA is
symbolized as address and symbol size rather than line number.
.sp
Object files can be specified together with the addresses either on standard
input or as positional arguments on the command\-line, following any "DATA" or
"CODE" prefix.
.sp
\fBllvm\-symbolizer\fP parses options from the environment variable
\fBLLVM_SYMBOLIZER_OPTS\fP after parsing options from the command line.
\fBLLVM_SYMBOLIZER_OPTS\fP is primarily useful for supplementing the command\-line
options when \fBllvm\-symbolizer\fP is invoked by another program or
runtime.
.SH EXAMPLES
.sp
All of the following examples use the following two source files as input. They
use a mixture of C\-style and C++\-style linkage to illustrate how these names are
printed differently (see \fI\%\-\-demangle\fP).
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
// test.h
extern "C" inline int foz() {
return 1234;
}
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
// test.cpp
#include "test.h"
int bar=42;
int foo() {
return bar;
}
int baz() {
volatile int k = 42;
return foz() + k;
}
int main() {
return foo() + baz();
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
These files are built as follows:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ clang \-g test.cpp \-o test.elf
$ clang \-g \-O2 test.cpp \-o inlined.elf
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example 1 \- addresses and object on command\-line:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer \-\-obj=test.elf 0x4004d0 0x400490
foz
/tmp/test.h:1:0
baz()
/tmp/test.cpp:11:0
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Example 2 \- addresses on standard input:
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.sp .sp
.nf .nf
.ft C .ft C
$ cat addr.txt $ cat addr.txt
a.out 0x4004f4 0x4004a0
/tmp/b.out 0x400528 0x400490
/tmp/c.so 0x710 0x4004d0
/tmp/mach_universal_binary:i386 0x1f84 $ llvm\-symbolizer \-\-obj=test.elf < addr.txt
/tmp/mach_universal_binary:x86_64 0x100000f24
$ llvm\-symbolizer < addr.txt
main main
/tmp/a.cc:4 /tmp/test.cpp:15:0
f(int, int) baz()
/tmp/b.cc:11 /tmp/test.cpp:11:0
h_inlined_into_g foz
/tmp/header.h:2 /tmp/./test.h:1:0
g_inlined_into_f .ft P
/tmp/header.h:7 .fi
f_inlined_into_main .UNINDENT
/tmp/source.cc:3 .UNINDENT
main .sp
/tmp/source.cc:8 Example 3 \- object specified with address:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer "test.elf 0x400490" "inlined.elf 0x400480"
baz()
/tmp/test.cpp:11:0
_main foo()
/tmp/source_i386.cc:8 /tmp/test.cpp:8:10
_main
/tmp/source_x86_64.cc:8
$ cat addr2.txt $ cat addr2.txt
0x4004f4 test.elf 0x4004a0
0x401000 inlined.elf 0x400480
$ llvm\-symbolizer \-obj=a.out < addr2.txt
main
/tmp/a.cc:4
foo(int) $ llvm\-symbolizer < addr2.txt
/tmp/a.cc:12 main
$cat addr.txt /tmp/test.cpp:15:0
0x40054d
$llvm\-symbolizer \-inlining \-print\-address \-pretty\-print \-obj=addr.exe < addr.txt foo()
0x40054d: inc at /tmp/x.c:3:3 /tmp/test.cpp:8:10
(inlined by) main at /tmp/x.c:9:0 .ft P
$llvm\-symbolizer \-inlining \-pretty\-print \-obj=addr.exe < addr.txt .fi
inc at /tmp/x.c:3:3 .UNINDENT
(inlined by) main at /tmp/x.c:9:0 .UNINDENT
.sp
Example 4 \- CODE and DATA prefixes:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer \-\-obj=test.elf "CODE 0x400490" "DATA 0x601028"
baz()
/tmp/test.cpp:11:0
bar
6295592 4
$ cat addr3.txt
CODE test.elf 0x4004a0
DATA inlined.elf 0x601028
$ llvm\-symbolizer < addr3.txt
main
/tmp/test.cpp:15:0
bar
6295592 4
.ft P .ft P
.fi .fi
.UNINDENT .UNINDENT
@ -98,66 +214,259 @@ inc at /tmp/x.c:3:3
.SH OPTIONS .SH OPTIONS
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-obj .B \-\-adjust\-vma <offset>
Path to object file to be symbolized. Add the specified offset to object file addresses when performing lookups.
This can be used to perform lookups as if the object were relocated by the
offset.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-functions=[none|short|linkage] .B \-\-basenames, \-s
Specify the way function names are printed (omit function name, Strip directories when printing the file path.
print short function name, or print full linkage name, respectively).
Defaults to \fBlinkage\fP\&.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-use\-symbol\-table .B \-\-demangle, \-C
Prefer function names stored in symbol table to function names Print demangled function names, if the names are mangled (e.g. the mangled
in debug info sections. Defaults to true. name \fI_Z3bazv\fP becomes \fIbaz()\fP, whilst the non\-mangled name \fIfoz\fP is printed
as is). Defaults to true.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-demangle .B \-\-dwp <path>
Print demangled function names. Defaults to true. Use the specified DWP file at \fB<path>\fP for any CUs that have split DWARF
debug data.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-inlining .B \-\-fallback\-debug\-path <path>
If a source code location is in an inlined function, prints all the When a separate file contains debug data, and is referenced by a GNU debug
inlnied frames. Defaults to true. link section, use the specified path as a basis for locating the debug data if
it cannot be found relative to the object.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-default\-arch .B \-\-functions [<none|short|linkage>], \-f
If a binary contains object files for multiple architectures (e.g. it is a Specify the way function names are printed (omit function name, print short
Mach\-O universal binary), symbolize the object file for a given architecture. function name, or print full linkage name, respectively). Defaults to
You can also specify architecture by writing \fBbinary_name:arch_name\fP in the \fBlinkage\fP\&.
input (see example above). If architecture is not specified in either way,
address will not be symbolized. Defaults to empty string.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-dsym\-hint=<path/to/file.dSYM> .B \-\-help, \-h
(Darwin\-only flag). If the debug info for a binary isn\(aqt present in the default Show help and usage for this command.
location, look for the debug info at the .dSYM path provided via the
\fB\-dsym\-hint\fP flag. This flag can be used multiple times.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-print\-address .B \-\-help\-list
Show help and usage for this command without grouping the options into categories.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-inlining, \-\-inlines, \-i
If a source code location is in an inlined function, prints all the inlined
frames. Defaults to true.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-demangle
Don\(aqt print demangled function names.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-obj <path>, \-\-exe, \-e
Path to object file to be symbolized. If \fB\-\fP is specified, read the object
directly from the standard input stream.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-output\-style <LLVM|GNU>
Specify the preferred output style. Defaults to \fBLLVM\fP\&. When the output
style is set to \fBGNU\fP, the tool follows the style of GNU\(aqs \fBaddr2line\fP\&.
The differences from the \fBLLVM\fP style are:
.INDENT 7.0
.IP \(bu 2
Does not print the column of a source code location.
.IP \(bu 2
Does not add an empty line after the report for an address.
.IP \(bu 2
Does not replace the name of an inlined function with the name of the
topmost caller when inlined frames are not shown and \fI\%\-\-use\-symbol\-table\fP
is on.
.UNINDENT
.INDENT 7.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer \-\-obj=inlined.elf 0x4004be 0x400486 \-p
baz() at /tmp/test.cpp:11:18
(inlined by) main at /tmp/test.cpp:15:0
foo() at /tmp/test.cpp:6:3
$ llvm\-symbolizer \-\-output\-style=LLVM \-\-obj=inlined.elf 0x4004be 0x400486 \-p \-i=0
main at /tmp/test.cpp:11:18
foo() at /tmp/test.cpp:6:3
$ llvm\-symbolizer \-\-output\-style=GNU \-\-obj=inlined.elf 0x4004be 0x400486 \-p \-i=0
baz() at /tmp/test.cpp:11
foo() at /tmp/test.cpp:6
.ft P
.fi
.UNINDENT
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-pretty\-print, \-p
Print human readable output. If \fI\%\-\-inlining\fP is specified, the
enclosing scope is prefixed by (inlined by).
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer \-\-obj=inlined.elf 0x4004be \-\-inlining \-\-pretty\-print
baz() at /tmp/test.cpp:11:18
(inlined by) main at /tmp/test.cpp:15:0
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-print\-address, \-\-addresses, \-a
Print address before the source code location. Defaults to false. Print address before the source code location. Defaults to false.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer \-\-obj=inlined.elf \-\-print\-address 0x4004be
0x4004be
baz()
/tmp/test.cpp:11:18
main
/tmp/test.cpp:15:0
$ llvm\-symbolizer \-\-obj=inlined.elf 0x4004be \-\-pretty\-print \-\-print\-address
0x4004be: baz() at /tmp/test.cpp:11:18
(inlined by) main at /tmp/test.cpp:15:0
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP .TP
.B \-pretty\-print .B \-\-print\-source\-context\-lines <N>
Print human readable output. If \fB\-inlining\fP is specified, enclosing scope is Print \fBN\fP lines of source context for each symbolized address.
prefixed by (inlined by). Refer to listed examples. .UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer \-\-obj=test.elf 0x400490 \-\-print\-source\-context\-lines=2
baz()
/tmp/test.cpp:11:0
10 : volatile int k = 42;
11 >: return foz() + k;
12 : }
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-use\-symbol\-table
Prefer function names stored in symbol table to function names in debug info
sections. Defaults to true.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-verbose
Print verbose line and column information.
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ llvm\-symbolizer \-\-obj=inlined.elf \-\-verbose 0x4004be
baz()
Filename: /tmp/test.cpp
Function start line: 9
Line: 11
Column: 18
main
Filename: /tmp/test.cpp
Function start line: 14
Line: 15
Column: 0
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-version
Print version information for the tool.
.UNINDENT
.INDENT 0.0
.TP
.B @<FILE>
Read command\-line options from response file \fI<FILE>\fP\&.
.UNINDENT
.SH MACH-O SPECIFIC OPTIONS
.INDENT 0.0
.TP
.B \-\-default\-arch <arch>
If a binary contains object files for multiple architectures (e.g. it is a
Mach\-O universal binary), symbolize the object file for a given architecture.
You can also specify the architecture by writing \fBbinary_name:arch_name\fP in
the input (see example below). If the architecture is not specified in either
way, the address will not be symbolized. Defaults to empty string.
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ cat addr.txt
/tmp/mach_universal_binary:i386 0x1f84
/tmp/mach_universal_binary:x86_64 0x100000f24
$ llvm\-symbolizer < addr.txt
_main
/tmp/source_i386.cc:8
_main
/tmp/source_x86_64.cc:8
.ft P
.fi
.UNINDENT
.UNINDENT
.INDENT 0.0
.TP
.B \-\-dsym\-hint <path/to/file.dSYM>
If the debug info for a binary isn\(aqt present in the default location, look for
the debug info at the .dSYM path provided via this option. This flag can be
used multiple times.
.UNINDENT .UNINDENT
.SH EXIT STATUS .SH EXIT STATUS
.sp .sp
\fBllvm\-symbolizer\fP returns 0. Other exit codes imply internal program error. \fBllvm\-symbolizer\fP returns 0. Other exit codes imply an internal program
error.
.SH SEE ALSO
.sp
\fBllvm\-addr2line(1)\fP
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "TBLGEN" "1" "2018-08-02" "7" "LLVM" .TH "TBLGEN" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
tblgen \- Target Description To C++ Code Generator tblgen \- Target Description To C++ Code Generator
. .
@ -178,6 +178,11 @@ Generate enhanced disassembly info.
.UNINDENT .UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-gen\-exegesis
Generate llvm\-exegesis tables.
.UNINDENT
.INDENT 0.0
.TP
.B \-version .B \-version
Show the version number of this program. Show the version number of this program.
.UNINDENT .UNINDENT
@ -186,8 +191,8 @@ Show the version number of this program.
If \fBtblgen\fP succeeds, it will exit with 0. Otherwise, if an error If \fBtblgen\fP succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non\-zero value. occurs, it will exit with a non\-zero value.
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .

View File

@ -1,7 +1,7 @@
.\" $FreeBSD$ .\" $FreeBSD$
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "OPT" "1" "2018-08-02" "7" "LLVM" .TH "OPT" "1" "2020-06-26" "10" "LLVM"
.SH NAME .SH NAME
opt \- LLVM optimizer opt \- LLVM optimizer
. .
@ -163,8 +163,8 @@ Print module after each transformation.
If \fBopt\fP succeeds, it will exit with 0. Otherwise, if an error If \fBopt\fP succeeds, it will exit with 0. Otherwise, if an error
occurs, it will exit with a non\-zero value. occurs, it will exit with a non\-zero value.
.SH AUTHOR .SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/). Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT .SH COPYRIGHT
2003-2018, LLVM Project 2003-2020, LLVM Project
.\" Generated by docutils manpage writer. .\" Generated by docutils manpage writer.
. .