diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:04:03 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:04:03 +0000 |
commit | 8cf58e3ee36bd550746fca361a894e2727485200 (patch) | |
tree | 2ba0398b4c42ad4f55561327538044fd2c925a8b /docs/CommandGuide | |
parent | aa45f148926e3461a1fd8b10c990f0a51a908cc9 (diff) | |
download | FreeBSD-src-8cf58e3ee36bd550746fca361a894e2727485200.zip FreeBSD-src-8cf58e3ee36bd550746fca361a894e2727485200.tar.gz |
Vendor import of llvm release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/llvm/branches/release_34@197841
Diffstat (limited to 'docs/CommandGuide')
-rw-r--r-- | docs/CommandGuide/FileCheck.rst | 145 | ||||
-rw-r--r-- | docs/CommandGuide/index.rst | 1 | ||||
-rw-r--r-- | docs/CommandGuide/lit.rst | 15 | ||||
-rw-r--r-- | docs/CommandGuide/llc.rst | 18 | ||||
-rw-r--r-- | docs/CommandGuide/llvm-ar.rst | 129 | ||||
-rw-r--r-- | docs/CommandGuide/llvm-extract.rst | 65 | ||||
-rw-r--r-- | docs/CommandGuide/llvm-nm.rst | 61 | ||||
-rw-r--r-- | docs/CommandGuide/llvm-ranlib.rst | 61 | ||||
-rw-r--r-- | docs/CommandGuide/llvm-symbolizer.rst | 16 |
9 files changed, 220 insertions, 291 deletions
diff --git a/docs/CommandGuide/FileCheck.rst b/docs/CommandGuide/FileCheck.rst index fce63ba..5a60d60 100644 --- a/docs/CommandGuide/FileCheck.rst +++ b/docs/CommandGuide/FileCheck.rst @@ -18,7 +18,8 @@ using :program:`grep`, but it is optimized for matching multiple different inputs in one file in a specific order. The ``match-filename`` file specifies the file that contains the patterns to -match. The file to verify is always read from standard input. +match. The file to verify is read from standard input unless the +:option:`--input-file` option is used. OPTIONS ------- @@ -29,11 +30,13 @@ OPTIONS .. option:: --check-prefix prefix - FileCheck searches the contents of ``match-filename`` for patterns to match. - By default, these patterns are prefixed with "``CHECK:``". If you'd like to - use a different prefix (e.g. because the same input file is checking multiple - different tool or options), the :option:`--check-prefix` argument allows you - to specify a specific prefix to match. + FileCheck searches the contents of ``match-filename`` for patterns to + match. By default, these patterns are prefixed with "``CHECK:``". + If you'd like to use a different prefix (e.g. because the same input + file is checking multiple different tool or options), the + :option:`--check-prefix` argument allows you to specify one or more + prefixes to match. Multiple prefixes are useful for tests which might + change for different run options, but most lines remain the same. .. option:: --input-file filename @@ -44,7 +47,7 @@ OPTIONS By default, FileCheck canonicalizes input horizontal whitespace (spaces and tabs) which causes it to ignore these differences (a space will match a tab). The :option:`--strict-whitespace` argument disables this behavior. End-of-line - sequences are canonicalized to UNIX-style '\n' in all modes. + sequences are canonicalized to UNIX-style ``\n`` in all modes. .. option:: -version @@ -194,6 +197,134 @@ can be used: ; CHECK: ret i8 } +The "CHECK-DAG:" directive +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If it's necessary to match strings that don't occur in a strictly sequential +order, "``CHECK-DAG:``" could be used to verify them between two matches (or +before the first match, or after the last match). For example, clang emits +vtable globals in reverse order. Using ``CHECK-DAG:``, we can keep the checks +in the natural order: + +.. code-block:: c++ + + // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s + + struct Foo { virtual void method(); }; + Foo f; // emit vtable + // CHECK-DAG: @_ZTV3Foo = + + struct Bar { virtual void method(); }; + Bar b; + // CHECK-DAG: @_ZTV3Bar = + +``CHECK-NOT:`` directives could be mixed with ``CHECK-DAG:`` directives to +exclude strings between the surrounding ``CHECK-DAG:`` directives. As a result, +the surrounding ``CHECK-DAG:`` directives cannot be reordered, i.e. all +occurrences matching ``CHECK-DAG:`` before ``CHECK-NOT:`` must not fall behind +occurrences matching ``CHECK-DAG:`` after ``CHECK-NOT:``. For example, + +.. code-block:: llvm + + ; CHECK-DAG: BEFORE + ; CHECK-NOT: NOT + ; CHECK-DAG: AFTER + +This case will reject input strings where ``BEFORE`` occurs after ``AFTER``. + +With captured variables, ``CHECK-DAG:`` is able to match valid topological +orderings of a DAG with edges from the definition of a variable to its use. +It's useful, e.g., when your test cases need to match different output +sequences from the instruction scheduler. For example, + +.. code-block:: llvm + + ; CHECK-DAG: add [[REG1:r[0-9]+]], r1, r2 + ; CHECK-DAG: add [[REG2:r[0-9]+]], r3, r4 + ; CHECK: mul r5, [[REG1]], [[REG2]] + +In this case, any order of that two ``add`` instructions will be allowed. + +If you are defining `and` using variables in the same ``CHECK-DAG:`` block, +be aware that the definition rule can match `after` its use. + +So, for instance, the code below will pass: + +.. code-block:: llvm + + ; CHECK-DAG: vmov.32 [[REG2:d[0-9]+]][0] + ; CHECK-DAG: vmov.32 [[REG2]][1] + vmov.32 d0[1] + vmov.32 d0[0] + +While this other code, will not: + +.. code-block:: llvm + + ; CHECK-DAG: vmov.32 [[REG2:d[0-9]+]][0] + ; CHECK-DAG: vmov.32 [[REG2]][1] + vmov.32 d1[1] + vmov.32 d0[0] + +While this can be very useful, it's also dangerous, because in the case of +register sequence, you must have a strong order (read before write, copy before +use, etc). If the definition your test is looking for doesn't match (because +of a bug in the compiler), it may match further away from the use, and mask +real bugs away. + +In those cases, to enforce the order, use a non-DAG directive between DAG-blocks. + +The "CHECK-LABEL:" directive +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sometimes in a file containing multiple tests divided into logical blocks, one +or more ``CHECK:`` directives may inadvertently succeed by matching lines in a +later block. While an error will usually eventually be generated, the check +flagged as causing the error may not actually bear any relationship to the +actual source of the problem. + +In order to produce better error messages in these cases, the "``CHECK-LABEL:``" +directive can be used. It is treated identically to a normal ``CHECK`` +directive except that FileCheck makes an additional assumption that a line +matched by the directive cannot also be matched by any other check present in +``match-filename``; this is intended to be used for lines containing labels or +other unique identifiers. Conceptually, the presence of ``CHECK-LABEL`` divides +the input stream into separate blocks, each of which is processed independently, +preventing a ``CHECK:`` directive in one block matching a line in another block. +For example, + +.. code-block:: llvm + + define %struct.C* @C_ctor_base(%struct.C* %this, i32 %x) { + entry: + ; CHECK-LABEL: C_ctor_base: + ; CHECK: mov [[SAVETHIS:r[0-9]+]], r0 + ; CHECK: bl A_ctor_base + ; CHECK: mov r0, [[SAVETHIS]] + %0 = bitcast %struct.C* %this to %struct.A* + %call = tail call %struct.A* @A_ctor_base(%struct.A* %0) + %1 = bitcast %struct.C* %this to %struct.B* + %call2 = tail call %struct.B* @B_ctor_base(%struct.B* %1, i32 %x) + ret %struct.C* %this + } + + define %struct.D* @D_ctor_base(%struct.D* %this, i32 %x) { + entry: + ; CHECK-LABEL: D_ctor_base: + +The use of ``CHECK-LABEL:`` directives in this case ensures that the three +``CHECK:`` directives only accept lines corresponding to the body of the +``@C_ctor_base`` function, even if the patterns match lines found later in +the file. Furthermore, if one of these three ``CHECK:`` directives fail, +FileCheck will recover by continuing to the next block, allowing multiple test +failures to be detected in a single invocation. + +There is no requirement that ``CHECK-LABEL:`` directives contain strings that +correspond to actual syntactic labels in a source or output language: they must +simply uniquely match a single line in the file being verified. + +``CHECK-LABEL:`` directives cannot contain variable definitions or uses. + FileCheck Pattern Matching Syntax ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/CommandGuide/index.rst b/docs/CommandGuide/index.rst index b3b4bc3..d50542d 100644 --- a/docs/CommandGuide/index.rst +++ b/docs/CommandGuide/index.rst @@ -21,7 +21,6 @@ Basic Commands lli llvm-link llvm-ar - llvm-ranlib llvm-nm llvm-prof llvm-config diff --git a/docs/CommandGuide/lit.rst b/docs/CommandGuide/lit.rst index 40c7646..4d84be6 100644 --- a/docs/CommandGuide/lit.rst +++ b/docs/CommandGuide/lit.rst @@ -149,12 +149,11 @@ ADDITIONAL OPTIONS .. option:: --show-suites - List the discovered test suites as part of the standard output. + List the discovered test suites and exit. -.. option:: --repeat=N +.. option:: --show-tests - Run each test ``N`` times. Currently this is primarily useful for timing - tests, other results are not collated in any reasonable fashion. + List all of the the discovered tests and exit. EXIT STATUS ----------- @@ -283,7 +282,7 @@ executed, two important global variables are predefined: discover and run tests in the test suite. Generally this will be a builtin test format available from the *lit.formats* module. - **test_src_root** The filesystem path to the test suite root. For out-of-dir + **test_source_root** The filesystem path to the test suite root. For out-of-dir builds this is the directory that will be scanned for tests. **test_exec_root** For out-of-dir builds, the path to the test suite root inside @@ -316,11 +315,15 @@ executed, two important global variables are predefined: *on_clone* function will generally modify), and (3) the test path to the new directory being scanned. + **pipefail** Normally a test using a shell pipe fails if any of the commands + on the pipe fail. If this is not desired, setting this variable to false + makes the test fail only if the last command in the pipe fails. + TEST DISCOVERY ~~~~~~~~~~~~~~ Once test suites are located, :program:`lit` recursively traverses the source -directory (following *test_src_root*) looking for tests. When :program:`lit` +directory (following *test_source_root*) looking for tests. When :program:`lit` enters a sub-directory, it first checks to see if a nested test suite is defined in that directory. If so, it loads that test suite recursively, otherwise it instantiates a local test config for the directory (see diff --git a/docs/CommandGuide/llc.rst b/docs/CommandGuide/llc.rst index e6a5976..02ad798 100644 --- a/docs/CommandGuide/llc.rst +++ b/docs/CommandGuide/llc.rst @@ -141,24 +141,24 @@ Tuning/Configuration Options .. option:: --regalloc=<allocator> - Specify the register allocator to use. The default ``allocator`` is *local*. + Specify the register allocator to use. Valid register allocators are: - *simple* + *basic* - Very simple "always spill" register allocator + Basic register allocator. - *local* + *fast* - Local register allocator + Fast register allocator. It is the default for unoptimized code. - *linearscan* + *greedy* - Linear scan global register allocator + Greedy register allocator. It is the default for optimized code. - *iterativescan* + *pbqp* - Iterative scan global register allocator + Register allocator based on 'Partitioned Boolean Quadratic Programming'. .. option:: --spiller=<spiller> diff --git a/docs/CommandGuide/llvm-ar.rst b/docs/CommandGuide/llvm-ar.rst index 8ff4192..d3ee993 100644 --- a/docs/CommandGuide/llvm-ar.rst +++ b/docs/CommandGuide/llvm-ar.rst @@ -21,64 +21,24 @@ LLVM program. However, the archive can contain any kind of file. By default, only the symbol table needs to be consulted, not each individual file member of the archive. -The **llvm-ar** command can be used to *read* both SVR4 and BSD style archive -files. However, it cannot be used to write them. While the **llvm-ar** command -produces files that are *almost* identical to the format used by other ``ar`` -implementations, it has two significant departures in order to make the -archive appropriate for LLVM. The first departure is that **llvm-ar** only -uses BSD4.4 style long path names (stored immediately after the header) and -never contains a string table for long names. The second departure is that the -symbol table is formated for efficient construction of an in-memory data -structure that permits rapid (red-black tree) lookups. Consequently, archives -produced with **llvm-ar** usually won't be readable or editable with any -``ar`` implementation or useful for linking. Using the ``f`` modifier to flatten -file names will make the archive readable by other ``ar`` implementations -but not for linking because the symbol table format for LLVM is unique. If an +The **llvm-ar** command can be used to *read* SVR4, GNU and BSD style archive +files. However, right now it can only write in the GNU format. If an SVR4 or BSD style archive is used with the ``r`` (replace) or ``q`` (quick -update) operations, the archive will be reconstructed in LLVM format. This -means that the string table will be dropped (in deference to BSD 4.4 long names) -and an LLVM symbol table will be added (by default). The system symbol table -will be retained. +update) operations, the archive will be reconstructed in GNU format. Here's where **llvm-ar** departs from previous ``ar`` implementations: *Symbol Table* - Since **llvm-ar** is intended to archive bitcode files, the symbol table - won't make much sense to anything but LLVM. Consequently, the symbol table's - format has been simplified. It consists simply of a sequence of pairs - of a file member index number as an LSB 4byte integer and a null-terminated - string. - + Since **llvm-ar** supports bitcode files. The symbol table it creates + is in GNU format and includes both native and bitcode files. *Long Paths* - Some ``ar`` implementations (SVR4) use a separate file member to record long - path names (> 15 characters). **llvm-ar** takes the BSD 4.4 and Mac OS X - approach which is to simply store the full path name immediately preceding - the data for the file. The path name is null terminated and may contain the - slash (/) character. - - - -*Directory Recursion* - - Most ``ar`` implementations do not recurse through directories but simply - ignore directories if they are presented to the program in the *files* - option. **llvm-ar**, however, can recurse through directory structures and - add all the files under a directory, if requested. - - - -*TOC Verbose Output* - - When **llvm-ar** prints out the verbose table of contents (``tv`` option), it - precedes the usual output with a character indicating the basic kind of - content in the file. A blank means the file is a regular file. A 'B' means - the file is an LLVM bitcode file. An 'S' means the file is the symbol table. - + Currently **llvm-ar** can read GNU and BSD long file names, but only writes + archives with the GNU format. @@ -124,20 +84,19 @@ m[abi] -p[k] +p - Print files to the standard output. The *k* modifier applies to this - operation. This operation simply prints the *files* indicated to the - standard output. If no *files* are specified, the entire archive is printed. - Printing bitcode files is ill-advised as they might confuse your terminal - settings. The *p* operation never modifies the archive. + Print files to the standard output. This operation simply prints the + *files* indicated to the standard output. If no *files* are + specified, the entire archive is printed. Printing bitcode files is + ill-advised as they might confuse your terminal settings. The *p* + operation never modifies the archive. -q[Rf] +q - Quickly append files to the end of the archive. The *R*, and *f* - modifiers apply to this operation. This operation quickly adds the + Quickly append files to the end of the archive. This operation quickly adds the *files* to the archive without checking for duplicates that should be removed first. If no *files* are specified, the archive is not modified. Because of the way that **llvm-ar** constructs the archive file, its dubious @@ -145,9 +104,9 @@ q[Rf] -r[Rabfu] +r[abu] - Replace or insert file members. The *R*, *a*, *b*, *f*, and *u* + Replace or insert file members. The *a*, *b*, and *u* modifiers apply to this operation. This operation will replace existing *files* or insert them at the end of the archive if they do not exist. If no *files* are specified, the archive is not modified. @@ -201,37 +160,12 @@ section (above) to determine which modifiers are applicable to which operations. -[f] - - Normally, **llvm-ar** stores the full path name to a file as presented to it on - the command line. With this option, truncated (15 characters max) names are - used. This ensures name compatibility with older versions of ``ar`` but may also - thwart correct extraction of the files (duplicates may overwrite). If used with - the *R* option, the directory recursion will be performed but the file names - will all be flattened to simple file names. - - - [i] A synonym for the *b* option. -[k] - - Normally, **llvm-ar** will not print the contents of bitcode files when the - *p* operation is used. This modifier defeats the default and allows the - bitcode members to be printed. - - - -[N] - - This option is ignored by **llvm-ar** but provided for compatibility. - - - [o] When extracting files, this option will cause **llvm-ar** to preserve the @@ -239,22 +173,6 @@ section (above) to determine which modifiers are applicable to which operations. -[P] - - use full path names when matching - - - -[R] - - This modifier instructions the *r* option to recursively process directories. - Without *R*, directories are ignored and only those *files* that refer to - files will be added to the archive. When *R* is used, any directories specified - with *files* will be scanned (recursively) to find files to be added to the - archive. Any file whose name begins with a dot will not be added. - - - [u] When replacing existing files in the archive, only replace those files that have @@ -283,8 +201,7 @@ The modifiers below may be applied to any operation. 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 all the externally visible functions and global variables defined by all the - bitcode files in the archive. Using this modifier is more efficient that using - llvm-ranlib|llvm-ranlib which also creates the symbol table. + bitcode files in the archive. @@ -401,14 +318,6 @@ fmag - char[2] utility in identifying archive files that have been corrupted. - -The LLVM symbol table has the special name "#_LLVM_SYM_TAB_#". It is presumed -that no regular archive member file will want this name. The LLVM symbol table -is simply composed of a sequence of triplets: byte offset, length of symbol, -and the symbol itself. Symbols are not null or newline terminated. Here are -the details on each of these items: - - offset - vbr encoded 32-bit integer The offset item provides the offset into the archive file where the bitcode @@ -455,4 +364,4 @@ SEE ALSO -------- -llvm-ranlib|llvm-ranlib, ar(1) +ar(1) diff --git a/docs/CommandGuide/llvm-extract.rst b/docs/CommandGuide/llvm-extract.rst index d569e35..d0e9c1c 100644 --- a/docs/CommandGuide/llvm-extract.rst +++ b/docs/CommandGuide/llvm-extract.rst @@ -1,104 +1,79 @@ llvm-extract - extract a function from an LLVM module ===================================================== - SYNOPSIS -------- - -**llvm-extract** [*options*] **--func** *function-name* [*filename*] - +:program:`llvm-extract` [*options*] **--func** *function-name* [*filename*] DESCRIPTION ----------- - -The **llvm-extract** command takes the name of a function and extracts it from -the specified LLVM bitcode file. It is primarily used as a debugging tool to -reduce test cases from larger programs that are triggering a bug. +The :program:`llvm-extract` command takes the name of a function and extracts +it from the specified LLVM bitcode file. It is primarily used as a debugging +tool to reduce test cases from larger programs that are triggering a bug. In addition to extracting the bitcode of the specified function, -**llvm-extract** will also remove unreachable global variables, prototypes, and -unused types. - -The **llvm-extract** command reads its input from standard input if filename is -omitted or if filename is -. The output is always written to standard output, -unless the **-o** option is specified (see below). +:program:`llvm-extract` will also remove unreachable global variables, +prototypes, and unused types. +The :program:`llvm-extract` command reads its input from standard input if +filename is omitted or if filename is ``-``. The output is always written to +standard output, unless the **-o** option is specified (see below). OPTIONS ------- - - **-f** - Enable binary output on terminals. Normally, **llvm-extract** will refuse to - write raw bitcode output if the output stream is a terminal. With this option, - **llvm-extract** will write raw bitcode regardless of the output device. - - + Enable binary output on terminals. Normally, :program:`llvm-extract` will + refuse to write raw bitcode output if the output stream is a terminal. With + this option, :program:`llvm-extract` will write raw bitcode regardless of the + output device. **--func** *function-name* - Extract the function named *function-name* from the LLVM bitcode. May be + Extract the function named *function-name* from the LLVM bitcode. May be specified multiple times to extract multiple functions at once. - - **--rfunc** *function-regular-expr* Extract the function(s) matching *function-regular-expr* from the LLVM bitcode. All functions matching the regular expression will be extracted. May be specified multiple times. - - **--glob** *global-name* - Extract the global variable named *global-name* from the LLVM bitcode. May be + Extract the global variable named *global-name* from the LLVM bitcode. May be specified multiple times to extract multiple global variables at once. - - **--rglob** *glob-regular-expr* Extract the global variable(s) matching *global-regular-expr* from the LLVM - bitcode. All global variables matching the regular expression will be extracted. - May be specified multiple times. - - + bitcode. All global variables matching the regular expression will be + extracted. May be specified multiple times. **-help** Print a summary of command line options. - - **-o** *filename* Specify the output filename. If filename is "-" (the default), then - **llvm-extract** sends its output to standard output. - - + :program:`llvm-extract` sends its output to standard output. **-S** Write output in LLVM intermediate language (instead of bitcode). - - - EXIT STATUS ----------- - -If **llvm-extract** succeeds, it will exit with 0. Otherwise, if an error +If :program:`llvm-extract` succeeds, it will exit with 0. Otherwise, if an error occurs, it will exit with a non-zero value. - SEE ALSO -------- +bugpoint -bugpoint|bugpoint diff --git a/docs/CommandGuide/llvm-nm.rst b/docs/CommandGuide/llvm-nm.rst index cbc7af2..83d9fba 100644 --- a/docs/CommandGuide/llvm-nm.rst +++ b/docs/CommandGuide/llvm-nm.rst @@ -1,189 +1,146 @@ llvm-nm - list LLVM bitcode and object file's symbol table ========================================================== - SYNOPSIS -------- - :program:`llvm-nm` [*options*] [*filenames...*] - DESCRIPTION ----------- - The :program:`llvm-nm` utility lists the names of symbols from the LLVM bitcode files, object files, or :program:`ar` archives containing them, named on the -command line. Each symbol is listed along with some simple information about its -provenance. If no file name is specified, or *-* is used as a file name, +command line. Each symbol is listed along with some simple information about +its provenance. If no file name is specified, or *-* is used as a file name, :program:`llvm-nm` will process a file on its standard input stream. :program:`llvm-nm`'s default output format is the traditional BSD :program:`nm` -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 -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. Type code characters currently supported, and their meanings, are as follows: - U Named object is referenced but undefined in this bitcode file - - C Common (multiple definitions link together into one def) - - W Weak reference (multiple definitions link together into zero or one definitions) - - t Local function (text) object - - T Global function (text) object - - d Local data object - - D Global data object - - ? Something unrecognizable - - Because LLVM bitcode files typically contain objects that are not considered to have addresses until they are linked into an executable image or dynamically compiled "just-in-time", :program:`llvm-nm` does not print an address for any -symbol in a LLVM bitcode file, even symbols which are defined in the bitcode +symbol in an LLVM bitcode file, even symbols which are defined in the bitcode file. - OPTIONS ------- - .. program:: llvm-nm - .. option:: -B (default) - Use BSD output format. Alias for :option:`--format=bsd`. - + Use BSD output format. Alias for :option:`--format=bsd`. .. option:: -P - Use POSIX.2 output format. Alias for :option:`--format=posix`. - + Use POSIX.2 output format. Alias for :option:`--format=posix`. .. option:: --debug-syms, -a Show all symbols, even debugger only. - .. option:: --defined-only Print only symbols defined in this file (as opposed to symbols which may be referenced by objects in this file, but not defined in this file.) - .. option:: --dynamic, -D Display dynamic symbols instead of normal symbols. - .. option:: --extern-only, -g Print only symbols whose definitions are external; that is, accessible from other files. - .. option:: --format=format, -f format - Select an output format; *format* may be *sysv*, *posix*, or *bsd*. The default + Select an output format; *format* may be *sysv*, *posix*, or *bsd*. The default is *bsd*. - .. option:: -help Print a summary of command-line options and their meanings. - .. option:: --no-sort, -p Shows symbols in order encountered. - .. option:: --numeric-sort, -n, -v Sort symbols by address. - .. option:: --print-file-name, -A, -o Precede each symbol with the file it came from. - .. option:: --print-size, -S Show symbol size instead of address. - .. option:: --size-sort Sort symbols by size. - .. option:: --undefined-only, -u Print only symbols referenced but not defined in this file. - BUGS ---- - * :program:`llvm-nm` cannot demangle C++ mangled names, like GNU :program:`nm` can. * :program:`llvm-nm` does not support the full set of arguments that GNU :program:`nm` does. - EXIT STATUS ----------- - :program:`llvm-nm` exits with an exit code of zero. - SEE ALSO -------- - -llvm-dis|llvm-dis, ar(1), nm(1) +llvm-dis, ar(1), nm(1) diff --git a/docs/CommandGuide/llvm-ranlib.rst b/docs/CommandGuide/llvm-ranlib.rst deleted file mode 100644 index 6658818..0000000 --- a/docs/CommandGuide/llvm-ranlib.rst +++ /dev/null @@ -1,61 +0,0 @@ -llvm-ranlib - Generate index for LLVM archive -============================================= - - -SYNOPSIS --------- - - -**llvm-ranlib** [--version] [-help] <archive-file> - - -DESCRIPTION ------------ - - -The **llvm-ranlib** command is similar to the common Unix utility, ``ranlib``. It -adds or updates the symbol table in an LLVM archive file. Note that using the -**llvm-ar** modifier *s* is usually more efficient than running **llvm-ranlib** -which is only provided only for completness and compatibility. Unlike other -implementations of ``ranlib``, **llvm-ranlib** indexes LLVM bitcode files, not -native object modules. You can list the contents of the symbol table with the -``llvm-nm -s`` command. - - -OPTIONS -------- - - - -*archive-file* - - Specifies the archive-file to which the symbol table is added or updated. - - - -*--version* - - Print the version of **llvm-ranlib** and exit without building a symbol table. - - - -*-help* - - Print usage help for **llvm-ranlib** and exit without building a symbol table. - - - - -EXIT STATUS ------------ - - -If **llvm-ranlib** succeeds, it will exit with 0. If an error occurs, a non-zero -exit code will be returned. - - -SEE ALSO --------- - - -llvm-ar|llvm-ar, ranlib(1) diff --git a/docs/CommandGuide/llvm-symbolizer.rst b/docs/CommandGuide/llvm-symbolizer.rst index 73babb1..e03be9b 100644 --- a/docs/CommandGuide/llvm-symbolizer.rst +++ b/docs/CommandGuide/llvm-symbolizer.rst @@ -22,6 +22,8 @@ EXAMPLE a.out 0x4004f4 /tmp/b.out 0x400528 /tmp/c.so 0x710 + /tmp/mach_universal_binary:i386 0x1f84 + /tmp/mach_universal_binary:x86_64 0x100000f24 $ llvm-symbolizer < addr.txt main /tmp/a.cc:4 @@ -38,6 +40,12 @@ EXAMPLE main /tmp/source.cc:8 + _main + /tmp/source_i386.cc:8 + + _main + /tmp/source_x86_64.cc:8 + OPTIONS ------- @@ -59,6 +67,14 @@ OPTIONS If a source code location is in an inlined function, prints all the inlnied frames. Defaults to true. +.. option:: -default-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 architecture by writing ``binary_name:arch_name`` in the + input (see example above). If architecture is not specified in either way, + address will not be symbolized. Defaults to empty string. + EXIT STATUS ----------- |