File: clang-doc.rst

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (65 lines) | stat: -rw-r--r-- 2,352 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
===================
Clang-Doc
===================

.. contents::

.. toctree::
   :maxdepth: 1

:program:`clang-doc` is a tool for generating C and C++ documenation from 
source code and comments. 

The tool is in a very early development stage, so you might encounter bugs and
crashes. Submitting reports with information about how to reproduce the issue
to `the LLVM bugtracker <https://llvm.org/bugs>`_ will definitely help the
project. If you have any ideas or suggestions, please to put a feature request
there.

Use
=====

:program:`clang-doc` is a `LibTooling
<https://clang.llvm.org/docs/LibTooling.html>`_-based tool, and so requires a
compile command database for your project (for an example of how to do this 
see `How To Setup Tooling For LLVM
<https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html>`_).

The tool can be used on a single file or multiple files as defined in 
the compile commands database:

.. code-block:: console

  $ clang-doc /path/to/file.cpp -p /path/to/compile/commands

This generates an intermediate representation of the declarations and their
associated information in the specified TUs, serialized to LLVM bitcode.

As currently implemented, the tool is only able to parse TUs that can be 
stored in-memory. Future additions will extend the current framework to use
map-reduce frameworks to allow for use with large codebases.

:program:`clang-doc` offers the following options:

.. code-block:: console

	$ clang-doc --help
  USAGE: clang-doc [options] <source0> [... <sourceN>]

  OPTIONS:

  Generic Options:

    -help                      - Display available options (-help-hidden for more)
    -help-list                 - Display list of available options (-help-list-hidden for more)
    -version                   - Display the version of this program

  clang-doc options:

    -doxygen                   - Use only doxygen-style comments to generate docs.
    -dump                      - Dump intermediate results to bitcode file.
    -extra-arg=<string>        - Additional argument to append to the compiler command line
    -extra-arg-before=<string> - Additional argument to prepend to the compiler command line
    -omit-filenames            - Omit filenames in output.
    -output=<string>           - Directory for outputting generated files.
    -p=<string>                - Build path