mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 19:45:40 -04:00
Update our URLs in clang doc to use https
llvm-svn: 346101
This commit is contained in:
parent
a0a44e9c78
commit
bc5c3f5727
@ -24,7 +24,7 @@ Typical slowdown introduced by AddressSanitizer is **2x**.
|
|||||||
How to build
|
How to build
|
||||||
============
|
============
|
||||||
|
|
||||||
Build LLVM/Clang with `CMake <http://llvm.org/docs/CMake.html>`_.
|
Build LLVM/Clang with `CMake <https://llvm.org/docs/CMake.html>`_.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
@ -1 +1 @@
|
|||||||
*NOTE* This document has moved to http://clang.llvm.org/docs/Block-ABI-Apple.html.
|
*NOTE* This document has moved to https://clang.llvm.org/docs/Block-ABI-Apple.html.
|
||||||
|
@ -169,7 +169,7 @@ Visual Studio Integration
|
|||||||
=========================
|
=========================
|
||||||
|
|
||||||
Download the latest Visual Studio extension from the `alpha build site
|
Download the latest Visual Studio extension from the `alpha build site
|
||||||
<http://llvm.org/builds/>`_. The default key-binding is Ctrl-R,Ctrl-F.
|
<https://llvm.org/builds/>`_. The default key-binding is Ctrl-R,Ctrl-F.
|
||||||
|
|
||||||
|
|
||||||
Script for patch reformatting
|
Script for patch reformatting
|
||||||
|
@ -108,7 +108,7 @@ Configuring Style in Code
|
|||||||
|
|
||||||
When using ``clang::format::reformat(...)`` functions, the format is specified
|
When using ``clang::format::reformat(...)`` functions, the format is specified
|
||||||
by supplying the `clang::format::FormatStyle
|
by supplying the `clang::format::FormatStyle
|
||||||
<http://clang.llvm.org/doxygen/structclang_1_1format_1_1FormatStyle.html>`_
|
<https://clang.llvm.org/doxygen/structclang_1_1format_1_1FormatStyle.html>`_
|
||||||
structure.
|
structure.
|
||||||
|
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ the configuration (without a prefix: ``Auto``).
|
|||||||
|
|
||||||
* ``LLVM``
|
* ``LLVM``
|
||||||
A style complying with the `LLVM coding standards
|
A style complying with the `LLVM coding standards
|
||||||
<http://llvm.org/docs/CodingStandards.html>`_
|
<https://llvm.org/docs/CodingStandards.html>`_
|
||||||
* ``Google``
|
* ``Google``
|
||||||
A style complying with `Google's C++ style guide
|
A style complying with `Google's C++ style guide
|
||||||
<http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml>`_
|
<http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml>`_
|
||||||
@ -1290,7 +1290,7 @@ the configuration (without a prefix: ``Auto``).
|
|||||||
If none of the regular expressions match, INT_MAX is assigned as
|
If none of the regular expressions match, INT_MAX is assigned as
|
||||||
category. The main header for a source file automatically gets category 0.
|
category. The main header for a source file automatically gets category 0.
|
||||||
so that it is generally kept at the beginning of the ``#includes``
|
so that it is generally kept at the beginning of the ``#includes``
|
||||||
(http://llvm.org/docs/CodingStandards.html#include-style). However, you
|
(https://llvm.org/docs/CodingStandards.html#include-style). However, you
|
||||||
can also assign negative priorities if you have certain headers that
|
can also assign negative priorities if you have certain headers that
|
||||||
always need to be first.
|
always need to be first.
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ Putting it all together
|
|||||||
Let's look at an example plugin that prints top-level function names. This
|
Let's look at an example plugin that prints top-level function names. This
|
||||||
example is checked into the clang repository; please take a look at
|
example is checked into the clang repository; please take a look at
|
||||||
the `latest version of PrintFunctionNames.cpp
|
the `latest version of PrintFunctionNames.cpp
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/PrintFunctionNames.cpp?view=markup>`_.
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/PrintFunctionNames.cpp?view=markup>`_.
|
||||||
|
|
||||||
Running the plugin
|
Running the plugin
|
||||||
==================
|
==================
|
||||||
@ -110,7 +110,7 @@ source tree:
|
|||||||
-plugin -Xclang print-fns
|
-plugin -Xclang print-fns
|
||||||
|
|
||||||
Also see the print-function-name plugin example's
|
Also see the print-function-name plugin example's
|
||||||
`README <http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/README.txt?view=markup>`_
|
`README <https://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/README.txt?view=markup>`_
|
||||||
|
|
||||||
|
|
||||||
Using the clang command line
|
Using the clang command line
|
||||||
|
@ -19,12 +19,12 @@ LLVM/Clang checkout:
|
|||||||
- With Subversion:
|
- With Subversion:
|
||||||
|
|
||||||
- ``cd llvm/tools/clang/tools``
|
- ``cd llvm/tools/clang/tools``
|
||||||
- ``svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra``
|
- ``svn co https://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra``
|
||||||
|
|
||||||
- Or with Git:
|
- Or with Git:
|
||||||
|
|
||||||
- ``cd llvm/tools/clang/tools``
|
- ``cd llvm/tools/clang/tools``
|
||||||
- ``git clone http://llvm.org/git/clang-tools-extra.git extra``
|
- ``git clone https://llvm.org/git/clang-tools-extra.git extra``
|
||||||
|
|
||||||
This document describes a high-level overview of the organization of
|
This document describes a high-level overview of the organization of
|
||||||
Clang Tools within the project as well as giving an introduction to some
|
Clang Tools within the project as well as giving an introduction to some
|
||||||
@ -105,7 +105,7 @@ provide its own user-focused documentation.
|
|||||||
``clang-tidy``
|
``clang-tidy``
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
`clang-tidy <http://clang.llvm.org/extra/clang-tidy/>`_ is a clang-based C++
|
`clang-tidy <https://clang.llvm.org/extra/clang-tidy/>`_ is a clang-based C++
|
||||||
linter tool. It provides an extensible framework for building compiler-based
|
linter tool. It provides an extensible framework for building compiler-based
|
||||||
static analyses detecting and fixing bug-prone patterns, performance,
|
static analyses detecting and fixing bug-prone patterns, performance,
|
||||||
portability and maintainability issues.
|
portability and maintainability issues.
|
||||||
|
@ -60,7 +60,7 @@ Linker
|
|||||||
|
|
||||||
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 <http://clang-analyzer.llvm.org> for more details
|
the same driver. Please see <https://clang-analyzer.llvm.org> for more details
|
||||||
on how to use the static analyzer.
|
on how to use the static analyzer.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
@ -361,7 +361,7 @@ Code Generation Options
|
|||||||
:option:`-Oz` Like :option:`-Os` (and thus :option:`-O2`), but reduces code
|
:option:`-Oz` Like :option:`-Os` (and thus :option:`-O2`), but reduces code
|
||||||
size further.
|
size further.
|
||||||
|
|
||||||
:option:`-Og` Like :option:`-O1`. In future versions, this option might
|
:option:`-Og` Like :option:`-O1`. In future versions, this option might
|
||||||
disable different optimizations in order to improve debuggability.
|
disable different optimizations in order to improve debuggability.
|
||||||
|
|
||||||
:option:`-O` Equivalent to :option:`-O2`.
|
:option:`-O` Equivalent to :option:`-O2`.
|
||||||
@ -625,7 +625,7 @@ ENVIRONMENT
|
|||||||
BUGS
|
BUGS
|
||||||
----
|
----
|
||||||
|
|
||||||
To report bugs, please visit <http://llvm.org/bugs/>. Most bug reports should
|
To report bugs, please visit <https://bugs.llvm.org/>. Most bug reports should
|
||||||
include preprocessed source files (use the :option:`-E` option) and the full
|
include preprocessed source files (use the :option:`-E` option) and the full
|
||||||
output of the compiler, along with information to reproduce.
|
output of the compiler, along with information to reproduce.
|
||||||
|
|
||||||
@ -633,4 +633,3 @@ SEE ALSO
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
:manpage:`as(1)`, :manpage:`ld(1)`
|
:manpage:`as(1)`, :manpage:`ld(1)`
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ Experimental support for :ref:`cross-DSO control flow integrity
|
|||||||
<cfi-cross-dso>` exists that does not require classes to have hidden LTO
|
<cfi-cross-dso>` exists that does not require classes to have hidden LTO
|
||||||
visibility. This cross-DSO support has unstable ABI at this time.
|
visibility. This cross-DSO support has unstable ABI at this time.
|
||||||
|
|
||||||
.. _gold plugin: http://llvm.org/docs/GoldPlugin.html
|
.. _gold plugin: https://llvm.org/docs/GoldPlugin.html
|
||||||
|
|
||||||
.. _cfi-schemes:
|
.. _cfi-schemes:
|
||||||
|
|
||||||
|
@ -93,8 +93,8 @@ the bit vectors for the whole program. It currently does this using LLVM's
|
|||||||
`type metadata`_ mechanism together with link-time optimization.
|
`type metadata`_ mechanism together with link-time optimization.
|
||||||
|
|
||||||
.. _address point: http://itanium-cxx-abi.github.io/cxx-abi/abi.html#vtable-general
|
.. _address point: http://itanium-cxx-abi.github.io/cxx-abi/abi.html#vtable-general
|
||||||
.. _type metadata: http://llvm.org/docs/TypeMetadata.html
|
.. _type metadata: https://llvm.org/docs/TypeMetadata.html
|
||||||
.. _ByteArrayBuilder: http://llvm.org/docs/doxygen/html/structllvm_1_1ByteArrayBuilder.html
|
.. _ByteArrayBuilder: https://llvm.org/docs/doxygen/html/structllvm_1_1ByteArrayBuilder.html
|
||||||
|
|
||||||
Optimizations
|
Optimizations
|
||||||
-------------
|
-------------
|
||||||
@ -196,7 +196,7 @@ those sub-hierarchies need to be (see "Stripping Leading/Trailing Zeros in Bit
|
|||||||
Vectors" above). The `GlobalLayoutBuilder`_ class is responsible for laying
|
Vectors" above). The `GlobalLayoutBuilder`_ class is responsible for laying
|
||||||
out the globals efficiently to minimize the sizes of the underlying bitsets.
|
out the globals efficiently to minimize the sizes of the underlying bitsets.
|
||||||
|
|
||||||
.. _GlobalLayoutBuilder: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/LowerTypeTests.h?view=markup
|
.. _GlobalLayoutBuilder: https://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/LowerTypeTests.h?view=markup
|
||||||
|
|
||||||
Alignment
|
Alignment
|
||||||
~~~~~~~~~
|
~~~~~~~~~
|
||||||
|
@ -15,7 +15,7 @@ build system or Makefiles, nor choosing the right CMake options, etc.
|
|||||||
Also, it does not cover all the possible options, nor does it contain
|
Also, it does not cover all the possible options, nor does it contain
|
||||||
specific examples for specific architectures. For a concrete example, the
|
specific examples for specific architectures. For a concrete example, the
|
||||||
`instructions for cross-compiling LLVM itself
|
`instructions for cross-compiling LLVM itself
|
||||||
<http://llvm.org/docs/HowToCrossCompileLLVM.html>`_ may be of interest.
|
<https://llvm.org/docs/HowToCrossCompileLLVM.html>`_ may be of interest.
|
||||||
|
|
||||||
After reading this document, you should be familiar with the main issues
|
After reading this document, you should be familiar with the main issues
|
||||||
related to cross-compilation, and what main compiler options Clang provides
|
related to cross-compilation, and what main compiler options Clang provides
|
||||||
|
@ -19,7 +19,7 @@ LLVM Support Library
|
|||||||
====================
|
====================
|
||||||
|
|
||||||
The LLVM ``libSupport`` library provides many underlying libraries and
|
The LLVM ``libSupport`` library provides many underlying libraries and
|
||||||
`data-structures <http://llvm.org/docs/ProgrammersManual.html>`_, including
|
`data-structures <https://llvm.org/docs/ProgrammersManual.html>`_, including
|
||||||
command line option processing, various containers and a system abstraction
|
command line option processing, various containers and a system abstraction
|
||||||
layer, which is used for file system access.
|
layer, which is used for file system access.
|
||||||
|
|
||||||
@ -562,7 +562,7 @@ Precompiled Headers
|
|||||||
Clang supports two implementations of precompiled headers. The default
|
Clang supports two implementations of precompiled headers. The default
|
||||||
implementation, precompiled headers (:doc:`PCH <PCHInternals>`) uses a
|
implementation, precompiled headers (:doc:`PCH <PCHInternals>`) uses a
|
||||||
serialized representation of Clang's internal data structures, encoded with the
|
serialized representation of Clang's internal data structures, encoded with the
|
||||||
`LLVM bitstream format <http://llvm.org/docs/BitCodeFormat.html>`_.
|
`LLVM bitstream format <https://llvm.org/docs/BitCodeFormat.html>`_.
|
||||||
Pretokenized headers (:doc:`PTH <PTHInternals>`), on the other hand, contain a
|
Pretokenized headers (:doc:`PTH <PTHInternals>`), on the other hand, contain a
|
||||||
serialized representation of the tokens encountered when preprocessing a header
|
serialized representation of the tokens encountered when preprocessing a header
|
||||||
(and anything that header includes).
|
(and anything that header includes).
|
||||||
@ -1690,7 +1690,7 @@ semantic checking for some attributes, etc.
|
|||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
The first step to adding a new attribute to Clang is to add its definition to
|
The first step to adding a new attribute to Clang is to add its definition to
|
||||||
`include/clang/Basic/Attr.td
|
`include/clang/Basic/Attr.td
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?view=markup>`_.
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?view=markup>`_.
|
||||||
This tablegen definition must derive from the ``Attr`` (tablegen, not
|
This tablegen definition must derive from the ``Attr`` (tablegen, not
|
||||||
semantic) type, or one of its derivatives. Most attributes will derive from the
|
semantic) type, or one of its derivatives. Most attributes will derive from the
|
||||||
``InheritableAttr`` type, which specifies that the attribute can be inherited by
|
``InheritableAttr`` type, which specifies that the attribute can be inherited by
|
||||||
@ -1752,10 +1752,10 @@ the ``SubjectList``. The diagnostics generated for subject list violations are
|
|||||||
either ``diag::warn_attribute_wrong_decl_type`` or
|
either ``diag::warn_attribute_wrong_decl_type`` or
|
||||||
``diag::err_attribute_wrong_decl_type``, and the parameter enumeration is found
|
``diag::err_attribute_wrong_decl_type``, and the parameter enumeration is found
|
||||||
in `include/clang/Sema/ParsedAttr.h
|
in `include/clang/Sema/ParsedAttr.h
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ParsedAttr.h?view=markup>`_
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/ParsedAttr.h?view=markup>`_
|
||||||
If a previously unused Decl node is added to the ``SubjectList``, the logic used
|
If a previously unused Decl node is added to the ``SubjectList``, the logic used
|
||||||
to automatically determine the diagnostic parameter in `utils/TableGen/ClangAttrEmitter.cpp
|
to automatically determine the diagnostic parameter in `utils/TableGen/ClangAttrEmitter.cpp
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup>`_
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup>`_
|
||||||
may need to be updated.
|
may need to be updated.
|
||||||
|
|
||||||
By default, all subjects in the SubjectList must either be a Decl node defined
|
By default, all subjects in the SubjectList must either be a Decl node defined
|
||||||
@ -1777,7 +1777,7 @@ All attributes must have some form of documentation associated with them.
|
|||||||
Documentation is table generated on the public web server by a server-side
|
Documentation is table generated on the public web server by a server-side
|
||||||
process that runs daily. Generally, the documentation for an attribute is a
|
process that runs daily. Generally, the documentation for an attribute is a
|
||||||
stand-alone definition in `include/clang/Basic/AttrDocs.td
|
stand-alone definition in `include/clang/Basic/AttrDocs.td
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttdDocs.td?view=markup>`_
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttdDocs.td?view=markup>`_
|
||||||
that is named after the attribute being documented.
|
that is named after the attribute being documented.
|
||||||
|
|
||||||
If the attribute is not for public consumption, or is an implicitly-created
|
If the attribute is not for public consumption, or is an implicitly-created
|
||||||
@ -1828,7 +1828,7 @@ All arguments have a name and a flag that specifies whether the argument is
|
|||||||
optional. The associated C++ type of the argument is determined by the argument
|
optional. The associated C++ type of the argument is determined by the argument
|
||||||
definition type. If the existing argument types are insufficient, new types can
|
definition type. If the existing argument types are insufficient, new types can
|
||||||
be created, but it requires modifying `utils/TableGen/ClangAttrEmitter.cpp
|
be created, but it requires modifying `utils/TableGen/ClangAttrEmitter.cpp
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup>`_
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup>`_
|
||||||
to properly support the type.
|
to properly support the type.
|
||||||
|
|
||||||
Other Properties
|
Other Properties
|
||||||
@ -1840,7 +1840,7 @@ document, however a few deserve mention.
|
|||||||
If the parsed form of the attribute is more complex, or differs from the
|
If the parsed form of the attribute is more complex, or differs from the
|
||||||
semantic form, the ``HasCustomParsing`` bit can be set to ``1`` for the class,
|
semantic form, the ``HasCustomParsing`` bit can be set to ``1`` for the class,
|
||||||
and the parsing code in `Parser::ParseGNUAttributeArgs()
|
and the parsing code in `Parser::ParseGNUAttributeArgs()
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?view=markup>`_
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?view=markup>`_
|
||||||
can be updated for the special case. Note that this only applies to arguments
|
can be updated for the special case. Note that this only applies to arguments
|
||||||
with a GNU spelling -- attributes with a __declspec spelling currently ignore
|
with a GNU spelling -- attributes with a __declspec spelling currently ignore
|
||||||
this flag and are handled by ``Parser::ParseMicrosoftDeclSpec``.
|
this flag and are handled by ``Parser::ParseMicrosoftDeclSpec``.
|
||||||
@ -1903,7 +1903,7 @@ semantic attribute class object, with ``public`` access.
|
|||||||
Boilerplate
|
Boilerplate
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
All semantic processing of declaration attributes happens in `lib/Sema/SemaDeclAttr.cpp
|
All semantic processing of declaration attributes happens in `lib/Sema/SemaDeclAttr.cpp
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?view=markup>`_,
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?view=markup>`_,
|
||||||
and generally starts in the ``ProcessDeclAttribute()`` function. If the
|
and generally starts in the ``ProcessDeclAttribute()`` function. If the
|
||||||
attribute is a "simple" attribute -- meaning that it requires no custom semantic
|
attribute is a "simple" attribute -- meaning that it requires no custom semantic
|
||||||
processing aside from what is automatically provided, add a call to
|
processing aside from what is automatically provided, add a call to
|
||||||
@ -1919,11 +1919,11 @@ correct minimum number of arguments are passed, etc.
|
|||||||
|
|
||||||
If the attribute adds additional warnings, define a ``DiagGroup`` in
|
If the attribute adds additional warnings, define a ``DiagGroup`` in
|
||||||
`include/clang/Basic/DiagnosticGroups.td
|
`include/clang/Basic/DiagnosticGroups.td
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?view=markup>`_
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?view=markup>`_
|
||||||
named after the attribute's ``Spelling`` with "_"s replaced by "-"s. If there
|
named after the attribute's ``Spelling`` with "_"s replaced by "-"s. If there
|
||||||
is only a single diagnostic, it is permissible to use ``InGroup<DiagGroup<"your-attribute">>``
|
is only a single diagnostic, it is permissible to use ``InGroup<DiagGroup<"your-attribute">>``
|
||||||
directly in `DiagnosticSemaKinds.td
|
directly in `DiagnosticSemaKinds.td
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?view=markup>`_
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?view=markup>`_
|
||||||
|
|
||||||
All semantic diagnostics generated for your attribute, including automatically-
|
All semantic diagnostics generated for your attribute, including automatically-
|
||||||
generated ones (such as subjects and argument counts), should have a
|
generated ones (such as subjects and argument counts), should have a
|
||||||
@ -2075,7 +2075,7 @@ are similar.
|
|||||||
exception-handling directly.
|
exception-handling directly.
|
||||||
* Testing is extremely important in IR generation. Use ``clang -cc1
|
* Testing is extremely important in IR generation. Use ``clang -cc1
|
||||||
-emit-llvm`` and `FileCheck
|
-emit-llvm`` and `FileCheck
|
||||||
<http://llvm.org/docs/CommandGuide/FileCheck.html>`_ to verify that you're
|
<https://llvm.org/docs/CommandGuide/FileCheck.html>`_ to verify that you're
|
||||||
generating the right IR.
|
generating the right IR.
|
||||||
|
|
||||||
#. Teach template instantiation how to cope with your AST node, which requires
|
#. Teach template instantiation how to cope with your AST node, which requires
|
||||||
|
@ -11,7 +11,7 @@ matchers.
|
|||||||
|
|
||||||
<center><iframe width="560" height="315" src="http://www.youtube.com/embed/VqCkCDFLSsc?vq=hd720" frameborder="0" allowfullscreen></iframe></center>
|
<center><iframe width="560" height="315" src="http://www.youtube.com/embed/VqCkCDFLSsc?vq=hd720" frameborder="0" allowfullscreen></iframe></center>
|
||||||
|
|
||||||
`Slides <http://llvm.org/devmtg/2013-04/klimek-slides.pdf>`_
|
`Slides <https://llvm.org/devmtg/2013-04/klimek-slides.pdf>`_
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
============
|
============
|
||||||
@ -23,7 +23,7 @@ constants are available in an unreduced form in the AST. This makes
|
|||||||
Clang's AST a good fit for refactoring tools.
|
Clang's AST a good fit for refactoring tools.
|
||||||
|
|
||||||
Documentation for all Clang AST nodes is available via the generated
|
Documentation for all Clang AST nodes is available via the generated
|
||||||
`Doxygen <http://clang.llvm.org/doxygen>`_. The doxygen online
|
`Doxygen <https://clang.llvm.org/doxygen>`_. The doxygen online
|
||||||
documentation is also indexed by your favorite search engine, which will
|
documentation is also indexed by your favorite search engine, which will
|
||||||
make a search for clang and the AST node's class name usually turn up
|
make a search for clang and the AST node's class name usually turn up
|
||||||
the doxygen of the class you're looking for (for example, search for:
|
the doxygen of the class you're looking for (for example, search for:
|
||||||
@ -67,26 +67,26 @@ Let's look at a simple example AST:
|
|||||||
|
|
||||||
The toplevel declaration in
|
The toplevel declaration in
|
||||||
a translation unit is always the `translation unit
|
a translation unit is always the `translation unit
|
||||||
declaration <http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html>`_.
|
declaration <https://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html>`_.
|
||||||
In this example, our first user written declaration is the `function
|
In this example, our first user written declaration is the `function
|
||||||
declaration <http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html>`_
|
declaration <https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html>`_
|
||||||
of "``f``". The body of "``f``" is a `compound
|
of "``f``". The body of "``f``" is a `compound
|
||||||
statement <http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html>`_,
|
statement <https://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html>`_,
|
||||||
whose child nodes are a `declaration
|
whose child nodes are a `declaration
|
||||||
statement <http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html>`_
|
statement <https://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html>`_
|
||||||
that declares our result variable, and the `return
|
that declares our result variable, and the `return
|
||||||
statement <http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html>`_.
|
statement <https://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html>`_.
|
||||||
|
|
||||||
AST Context
|
AST Context
|
||||||
===========
|
===========
|
||||||
|
|
||||||
All information about the AST for a translation unit is bundled up in
|
All information about the AST for a translation unit is bundled up in
|
||||||
the class
|
the class
|
||||||
`ASTContext <http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html>`_.
|
`ASTContext <https://clang.llvm.org/doxygen/classclang_1_1ASTContext.html>`_.
|
||||||
It allows traversal of the whole translation unit starting from
|
It allows traversal of the whole translation unit starting from
|
||||||
`getTranslationUnitDecl <http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#abd909fb01ef10cfd0244832a67b1dd64>`_,
|
`getTranslationUnitDecl <https://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#abd909fb01ef10cfd0244832a67b1dd64>`_,
|
||||||
or to access Clang's `table of
|
or to access Clang's `table of
|
||||||
identifiers <http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#a4f95adb9958e22fbe55212ae6482feb4>`_
|
identifiers <https://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#a4f95adb9958e22fbe55212ae6482feb4>`_
|
||||||
for the parsed translation unit.
|
for the parsed translation unit.
|
||||||
|
|
||||||
AST Nodes
|
AST Nodes
|
||||||
@ -95,32 +95,32 @@ AST Nodes
|
|||||||
Clang's AST nodes are modeled on a class hierarchy that does not have a
|
Clang's AST nodes are modeled on a class hierarchy that does not have a
|
||||||
common ancestor. Instead, there are multiple larger hierarchies for
|
common ancestor. Instead, there are multiple larger hierarchies for
|
||||||
basic node types like
|
basic node types like
|
||||||
`Decl <http://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_ and
|
`Decl <https://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_ and
|
||||||
`Stmt <http://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_. Many
|
`Stmt <https://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_. Many
|
||||||
important AST nodes derive from
|
important AST nodes derive from
|
||||||
`Type <http://clang.llvm.org/doxygen/classclang_1_1Type.html>`_,
|
`Type <https://clang.llvm.org/doxygen/classclang_1_1Type.html>`_,
|
||||||
`Decl <http://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_,
|
`Decl <https://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_,
|
||||||
`DeclContext <http://clang.llvm.org/doxygen/classclang_1_1DeclContext.html>`_
|
`DeclContext <https://clang.llvm.org/doxygen/classclang_1_1DeclContext.html>`_
|
||||||
or `Stmt <http://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_, with
|
or `Stmt <https://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_, with
|
||||||
some classes deriving from both Decl and DeclContext.
|
some classes deriving from both Decl and DeclContext.
|
||||||
|
|
||||||
There are also a multitude of nodes in the AST that are not part of a
|
There are also a multitude of nodes in the AST that are not part of a
|
||||||
larger hierarchy, and are only reachable from specific other nodes, like
|
larger hierarchy, and are only reachable from specific other nodes, like
|
||||||
`CXXBaseSpecifier <http://clang.llvm.org/doxygen/classclang_1_1CXXBaseSpecifier.html>`_.
|
`CXXBaseSpecifier <https://clang.llvm.org/doxygen/classclang_1_1CXXBaseSpecifier.html>`_.
|
||||||
|
|
||||||
Thus, to traverse the full AST, one starts from the
|
Thus, to traverse the full AST, one starts from the
|
||||||
`TranslationUnitDecl <http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html>`_
|
`TranslationUnitDecl <https://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html>`_
|
||||||
and then recursively traverses everything that can be reached from that
|
and then recursively traverses everything that can be reached from that
|
||||||
node - this information has to be encoded for each specific node type.
|
node - this information has to be encoded for each specific node type.
|
||||||
This algorithm is encoded in the
|
This algorithm is encoded in the
|
||||||
`RecursiveASTVisitor <http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html>`_.
|
`RecursiveASTVisitor <https://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html>`_.
|
||||||
See the `RecursiveASTVisitor
|
See the `RecursiveASTVisitor
|
||||||
tutorial <http://clang.llvm.org/docs/RAVFrontendAction.html>`_.
|
tutorial <https://clang.llvm.org/docs/RAVFrontendAction.html>`_.
|
||||||
|
|
||||||
The two most basic nodes in the Clang AST are statements
|
The two most basic nodes in the Clang AST are statements
|
||||||
(`Stmt <http://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_) and
|
(`Stmt <https://clang.llvm.org/doxygen/classclang_1_1Stmt.html>`_) and
|
||||||
declarations
|
declarations
|
||||||
(`Decl <http://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_). Note
|
(`Decl <https://clang.llvm.org/doxygen/classclang_1_1Decl.html>`_). Note
|
||||||
that expressions
|
that expressions
|
||||||
(`Expr <http://clang.llvm.org/doxygen/classclang_1_1Expr.html>`_) are
|
(`Expr <https://clang.llvm.org/doxygen/classclang_1_1Expr.html>`_) are
|
||||||
also statements in Clang's AST.
|
also statements in Clang's AST.
|
||||||
|
@ -590,7 +590,7 @@ which does not provide them. The features which can be tested are listed here.
|
|||||||
Since Clang 3.4, the C++ SD-6 feature test macros are also supported.
|
Since Clang 3.4, the C++ SD-6 feature test macros are also supported.
|
||||||
These are macros with names of the form ``__cpp_<feature_name>``, and are
|
These are macros with names of the form ``__cpp_<feature_name>``, and are
|
||||||
intended to be a portable way to query the supported features of the compiler.
|
intended to be a portable way to query the supported features of the compiler.
|
||||||
See `the C++ status page <http://clang.llvm.org/cxx_status.html#ts>`_ for
|
See `the C++ status page <https://clang.llvm.org/cxx_status.html#ts>`_ for
|
||||||
information on the version of SD-6 supported by each Clang release, and the
|
information on the version of SD-6 supported by each Clang release, and the
|
||||||
macros provided by that revision of the recommendations.
|
macros provided by that revision of the recommendations.
|
||||||
|
|
||||||
@ -1013,7 +1013,7 @@ Modules
|
|||||||
Use ``__has_feature(modules)`` to determine if Modules have been enabled.
|
Use ``__has_feature(modules)`` to determine if Modules have been enabled.
|
||||||
For example, compiling code with ``-fmodules`` enables the use of Modules.
|
For example, compiling code with ``-fmodules`` enables the use of Modules.
|
||||||
|
|
||||||
More information could be found `here <http://clang.llvm.org/docs/Modules.html>`_.
|
More information could be found `here <https://clang.llvm.org/docs/Modules.html>`_.
|
||||||
|
|
||||||
Checks for Type Trait Primitives
|
Checks for Type Trait Primitives
|
||||||
================================
|
================================
|
||||||
@ -1353,7 +1353,7 @@ In Objective-C, functions and methods are generally assumed to follow the
|
|||||||
conventions for ownership of object arguments and
|
conventions for ownership of object arguments and
|
||||||
return values. However, there are exceptions, and so Clang provides attributes
|
return values. However, there are exceptions, and so Clang provides attributes
|
||||||
to allow these exceptions to be documented. This are used by ARC and the
|
to allow these exceptions to be documented. This are used by ARC and the
|
||||||
`static analyzer <http://clang-analyzer.llvm.org>`_ Some exceptions may be
|
`static analyzer <https://clang-analyzer.llvm.org>`_ Some exceptions may be
|
||||||
better described using the ``objc_method_family`` attribute instead.
|
better described using the ``objc_method_family`` attribute instead.
|
||||||
|
|
||||||
**Usage**: The ``ns_returns_retained``, ``ns_returns_not_retained``,
|
**Usage**: The ``ns_returns_retained``, ``ns_returns_not_retained``,
|
||||||
@ -1390,7 +1390,7 @@ method; it specifies that the method expects its ``self`` parameter to have a
|
|||||||
- (void) baz:(id) __attribute__((ns_consumed)) x;
|
- (void) baz:(id) __attribute__((ns_consumed)) x;
|
||||||
|
|
||||||
Further examples of these attributes are available in the static analyzer's `list of annotations for analysis
|
Further examples of these attributes are available in the static analyzer's `list of annotations for analysis
|
||||||
<http://clang-analyzer.llvm.org/annotations.html#cocoa_mem>`_.
|
<https://clang-analyzer.llvm.org/annotations.html#cocoa_mem>`_.
|
||||||
|
|
||||||
Query for these features with ``__has_attribute(ns_consumed)``,
|
Query for these features with ``__has_attribute(ns_consumed)``,
|
||||||
``__has_attribute(ns_returns_retained)``, etc.
|
``__has_attribute(ns_returns_retained)``, etc.
|
||||||
@ -1411,7 +1411,7 @@ Objective-C methods. If such a check was missed, the program would compile
|
|||||||
fine, run fine on newer systems, but crash on older systems.
|
fine, run fine on newer systems, but crash on older systems.
|
||||||
|
|
||||||
As of LLVM 5.0, ``-Wunguarded-availability`` uses the `availability attributes
|
As of LLVM 5.0, ``-Wunguarded-availability`` uses the `availability attributes
|
||||||
<http://clang.llvm.org/docs/AttributeReference.html#availability>`_ together
|
<https://clang.llvm.org/docs/AttributeReference.html#availability>`_ together
|
||||||
with the new ``@available()`` keyword to assist with this issue.
|
with the new ``@available()`` keyword to assist with this issue.
|
||||||
When a method that's introduced in the OS newer than the target OS is called, a
|
When a method that's introduced in the OS newer than the target OS is called, a
|
||||||
-Wunguarded-availability warning is emitted if that call is not guarded:
|
-Wunguarded-availability warning is emitted if that call is not guarded:
|
||||||
@ -1454,7 +1454,7 @@ More than one platform can be listed in ``@available()``:
|
|||||||
|
|
||||||
If the caller of ``my_fun()`` already checks that ``my_fun()`` is only called
|
If the caller of ``my_fun()`` already checks that ``my_fun()`` is only called
|
||||||
on 10.12, then add an `availability attribute
|
on 10.12, then add an `availability attribute
|
||||||
<http://clang.llvm.org/docs/AttributeReference.html#availability>`_ to it,
|
<https://clang.llvm.org/docs/AttributeReference.html#availability>`_ to it,
|
||||||
which will also suppress the warning and require that calls to my_fun() are
|
which will also suppress the warning and require that calls to my_fun() are
|
||||||
checked:
|
checked:
|
||||||
|
|
||||||
@ -2041,7 +2041,7 @@ Floating point builtins
|
|||||||
Returns the platform specific canonical encoding of a floating point
|
Returns the platform specific canonical encoding of a floating point
|
||||||
number. This canonicalization is useful for implementing certain
|
number. This canonicalization is useful for implementing certain
|
||||||
numeric primitives such as frexp. See `LLVM canonicalize intrinsic
|
numeric primitives such as frexp. See `LLVM canonicalize intrinsic
|
||||||
<http://llvm.org/docs/LangRef.html#llvm-canonicalize-intrinsic>`_ for
|
<https://llvm.org/docs/LangRef.html#llvm-canonicalize-intrinsic>`_ for
|
||||||
more information on the semantics.
|
more information on the semantics.
|
||||||
|
|
||||||
String builtins
|
String builtins
|
||||||
@ -2255,7 +2255,7 @@ standard library to implement `std::experimental::coroutine_handle` type.
|
|||||||
|
|
||||||
Other coroutine builtins are either for internal clang use or for use during
|
Other coroutine builtins are either for internal clang use or for use during
|
||||||
development of the coroutine feature. See `Coroutines in LLVM
|
development of the coroutine feature. See `Coroutines in LLVM
|
||||||
<http://llvm.org/docs/Coroutines.html#intrinsics>`_ for
|
<https://llvm.org/docs/Coroutines.html#intrinsics>`_ for
|
||||||
more information on their semantics. Note that builtins matching the intrinsics
|
more information on their semantics. Note that builtins matching the intrinsics
|
||||||
that take token as the first parameter (llvm.coro.begin, llvm.coro.alloc,
|
that take token as the first parameter (llvm.coro.begin, llvm.coro.alloc,
|
||||||
llvm.coro.free and llvm.coro.suspend) omit the token parameter and fill it to
|
llvm.coro.free and llvm.coro.suspend) omit the token parameter and fill it to
|
||||||
@ -2362,9 +2362,9 @@ Extensions for Static Analysis
|
|||||||
|
|
||||||
Clang supports additional attributes that are useful for documenting program
|
Clang supports additional attributes that are useful for documenting program
|
||||||
invariants and rules for static analysis tools, such as the `Clang Static
|
invariants and rules for static analysis tools, such as the `Clang Static
|
||||||
Analyzer <http://clang-analyzer.llvm.org/>`_. These attributes are documented
|
Analyzer <https://clang-analyzer.llvm.org/>`_. These attributes are documented
|
||||||
in the analyzer's `list of source-level annotations
|
in the analyzer's `list of source-level annotations
|
||||||
<http://clang-analyzer.llvm.org/annotations.html>`_.
|
<https://clang-analyzer.llvm.org/annotations.html>`_.
|
||||||
|
|
||||||
|
|
||||||
Extensions for Dynamic Analysis
|
Extensions for Dynamic Analysis
|
||||||
|
@ -81,7 +81,7 @@ To that end, matchers that match specific AST nodes (so called node matchers)
|
|||||||
are bindable; for example, ``recordDecl(hasName("MyClass")).bind("id")`` will
|
are bindable; for example, ``recordDecl(hasName("MyClass")).bind("id")`` will
|
||||||
bind the matched ``recordDecl`` node to the string "``id``", to be later
|
bind the matched ``recordDecl`` node to the string "``id``", to be later
|
||||||
retrieved in the `match callback
|
retrieved in the `match callback
|
||||||
<http://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder_1_1MatchCallback.html>`_.
|
<https://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder_1_1MatchCallback.html>`_.
|
||||||
|
|
||||||
.. FIXME: Introduce link to ASTMatchersTutorial.html
|
.. FIXME: Introduce link to ASTMatchersTutorial.html
|
||||||
.. FIXME: Introduce link to ASTMatchersCookbook.html
|
.. FIXME: Introduce link to ASTMatchersCookbook.html
|
||||||
@ -116,7 +116,7 @@ corresponding matcher.
|
|||||||
|
|
||||||
There are multiple matcher definition macros that deal with polymorphic return
|
There are multiple matcher definition macros that deal with polymorphic return
|
||||||
values and different parameter counts. See `ASTMatchersMacros.h
|
values and different parameter counts. See `ASTMatchersMacros.h
|
||||||
<http://clang.llvm.org/doxygen/ASTMatchersMacros_8h.html>`_.
|
<https://clang.llvm.org/doxygen/ASTMatchersMacros_8h.html>`_.
|
||||||
|
|
||||||
.. _astmatchers-writing:
|
.. _astmatchers-writing:
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -19,16 +19,16 @@ As Clang is part of the LLVM project, you'll need to download LLVM's
|
|||||||
source code first. Both Clang and LLVM are maintained as Subversion
|
source code first. Both Clang and LLVM are maintained as Subversion
|
||||||
repositories, but we'll be accessing them through the git mirror. For
|
repositories, but we'll be accessing them through the git mirror. For
|
||||||
further information, see the `getting started
|
further information, see the `getting started
|
||||||
guide <http://llvm.org/docs/GettingStarted.html>`_.
|
guide <https://llvm.org/docs/GettingStarted.html>`_.
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
mkdir ~/clang-llvm && cd ~/clang-llvm
|
mkdir ~/clang-llvm && cd ~/clang-llvm
|
||||||
git clone http://llvm.org/git/llvm.git
|
git clone https://llvm.org/git/llvm.git
|
||||||
cd llvm/tools
|
cd llvm/tools
|
||||||
git clone http://llvm.org/git/clang.git
|
git clone https://llvm.org/git/clang.git
|
||||||
cd clang/tools
|
cd clang/tools
|
||||||
git clone http://llvm.org/git/clang-tools-extra.git extra
|
git clone https://llvm.org/git/clang-tools-extra.git extra
|
||||||
|
|
||||||
Next you need to obtain the CMake build system and Ninja build tool. You
|
Next you need to obtain the CMake build system and Ninja build tool. You
|
||||||
may already have CMake installed, but current binary versions of CMake
|
may already have CMake installed, but current binary versions of CMake
|
||||||
|
@ -45,7 +45,7 @@ two style guides are hard-coded:
|
|||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
/// Returns a format style complying with the LLVM coding standards:
|
/// Returns a format style complying with the LLVM coding standards:
|
||||||
/// http://llvm.org/docs/CodingStandards.html.
|
/// https://llvm.org/docs/CodingStandards.html.
|
||||||
FormatStyle getLLVMStyle();
|
FormatStyle getLLVMStyle();
|
||||||
|
|
||||||
/// Returns a format style complying with Google's C++ style guide:
|
/// Returns a format style complying with Google's C++ style guide:
|
||||||
|
@ -198,4 +198,4 @@ Linking
|
|||||||
|
|
||||||
For a list of libraries to link, look at one of the tools' Makefiles (for
|
For a list of libraries to link, look at one of the tools' Makefiles (for
|
||||||
example `clang-check/Makefile
|
example `clang-check/Makefile
|
||||||
<http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/Makefile?view=markup>`_).
|
<https://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-check/Makefile?view=markup>`_).
|
||||||
|
@ -70,7 +70,7 @@ The status of major ABI-impacting C++ features:
|
|||||||
.. _#pragma pointers_to_members:
|
.. _#pragma pointers_to_members:
|
||||||
http://msdn.microsoft.com/en-us/library/83cch5a6.aspx
|
http://msdn.microsoft.com/en-us/library/83cch5a6.aspx
|
||||||
.. _/vm: http://msdn.microsoft.com/en-us/library/yad46a6z.aspx
|
.. _/vm: http://msdn.microsoft.com/en-us/library/yad46a6z.aspx
|
||||||
.. _pointer to a member of a virtual base class: http://llvm.org/PR15713
|
.. _pointer to a member of a virtual base class: https://llvm.org/PR15713
|
||||||
|
|
||||||
* Debug info: :good:`Mostly complete`. Clang emits relatively complete CodeView
|
* Debug info: :good:`Mostly complete`. Clang emits relatively complete CodeView
|
||||||
debug information if ``/Z7`` or ``/Zi`` is passed. Microsoft's link.exe will
|
debug information if ``/Z7`` or ``/Zi`` is passed. Microsoft's link.exe will
|
||||||
@ -137,7 +137,7 @@ following program, Clang will recover as if the user had written the
|
|||||||
commented-out code:
|
commented-out code:
|
||||||
|
|
||||||
.. _frequently asked question:
|
.. _frequently asked question:
|
||||||
http://clang.llvm.org/compatibility.html#dep_lookup
|
https://clang.llvm.org/compatibility.html#dep_lookup
|
||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ Typical slowdown introduced by MemorySanitizer is **3x**.
|
|||||||
How to build
|
How to build
|
||||||
============
|
============
|
||||||
|
|
||||||
Build LLVM/Clang with `CMake <http://llvm.org/docs/CMake.html>`_.
|
Build LLVM/Clang with `CMake <https://llvm.org/docs/CMake.html>`_.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
@ -70,7 +70,7 @@ minimizes both creation time and the time required to initially load the AST
|
|||||||
file. The AST file itself contains a serialized representation of Clang's
|
file. The AST file itself contains a serialized representation of Clang's
|
||||||
abstract syntax trees and supporting data structures, stored using the same
|
abstract syntax trees and supporting data structures, stored using the same
|
||||||
compressed bitstream as `LLVM's bitcode file format
|
compressed bitstream as `LLVM's bitcode file format
|
||||||
<http://llvm.org/docs/BitCodeFormat.html>`_.
|
<https://llvm.org/docs/BitCodeFormat.html>`_.
|
||||||
|
|
||||||
Clang's AST files are loaded "lazily" from disk. When an AST file is initially
|
Clang's AST files are loaded "lazily" from disk. When an AST file is initially
|
||||||
loaded, Clang reads only a small amount of data from the AST file to establish
|
loaded, Clang reads only a small amount of data from the AST file to establish
|
||||||
@ -134,7 +134,7 @@ only contain the serialized AST.
|
|||||||
The ``clangast`` section is organized into several different blocks, each of
|
The ``clangast`` section is organized into several different blocks, each of
|
||||||
which contains the serialized representation of a part of Clang's internal
|
which contains the serialized representation of a part of Clang's internal
|
||||||
representation. Each of the blocks corresponds to either a block or a record
|
representation. Each of the blocks corresponds to either a block or a record
|
||||||
within `LLVM's bitstream format <http://llvm.org/docs/BitCodeFormat.html>`_.
|
within `LLVM's bitstream format <https://llvm.org/docs/BitCodeFormat.html>`_.
|
||||||
The contents of each of these logical blocks are described below.
|
The contents of each of these logical blocks are described below.
|
||||||
|
|
||||||
.. image:: PCHLayout.png
|
.. image:: PCHLayout.png
|
||||||
@ -142,7 +142,7 @@ The contents of each of these logical blocks are described below.
|
|||||||
The ``llvm-objdump`` utility provides a ``-raw-clang-ast`` option to extract the
|
The ``llvm-objdump`` utility provides a ``-raw-clang-ast`` option to extract the
|
||||||
binary contents of the AST section from an object file container.
|
binary contents of the AST section from an object file container.
|
||||||
|
|
||||||
The `llvm-bcanalyzer <http://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html>`_
|
The `llvm-bcanalyzer <https://llvm.org/docs/CommandGuide/llvm-bcanalyzer.html>`_
|
||||||
utility can be used to examine the actual structure of the bitstream for the AST
|
utility can be used to examine the actual structure of the bitstream for the AST
|
||||||
section. This information can be used both to help understand the structure of
|
section. This information can be used both to help understand the structure of
|
||||||
the AST section and to isolate areas where the AST representation can still be
|
the AST section and to isolate areas where the AST representation can still be
|
||||||
|
@ -245,7 +245,7 @@ around comparison instructions and switch statements.
|
|||||||
Similarly, with ``-fsanitize-coverage=trace-div`` the compiler will instrument
|
Similarly, with ``-fsanitize-coverage=trace-div`` the compiler will instrument
|
||||||
integer division instructions (to capture the right argument of division)
|
integer division instructions (to capture the right argument of division)
|
||||||
and with ``-fsanitize-coverage=trace-gep`` --
|
and with ``-fsanitize-coverage=trace-gep`` --
|
||||||
the `LLVM GEP instructions <http://llvm.org/docs/GetElementPtr.html>`_
|
the `LLVM GEP instructions <https://llvm.org/docs/GetElementPtr.html>`_
|
||||||
(to capture array indices).
|
(to capture array indices).
|
||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
@ -156,7 +156,7 @@ line-oriented report, try:
|
|||||||
The ``llvm-cov`` tool supports specifying a custom demangler, writing out
|
The ``llvm-cov`` tool supports specifying a custom demangler, writing out
|
||||||
reports in a directory structure, and generating html reports. For the full
|
reports in a directory structure, and generating html reports. For the full
|
||||||
list of options, please refer to the `command guide
|
list of options, please refer to the `command guide
|
||||||
<http://llvm.org/docs/CommandGuide/llvm-cov.html>`_.
|
<https://llvm.org/docs/CommandGuide/llvm-cov.html>`_.
|
||||||
|
|
||||||
A few final notes:
|
A few final notes:
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ The 3.9 release of clang includes ThinLTO support. However, ThinLTO
|
|||||||
is under active development, and new features, improvements and bugfixes
|
is under active development, and new features, improvements and bugfixes
|
||||||
are being added for the next release. For the latest ThinLTO support,
|
are being added for the next release. For the latest ThinLTO support,
|
||||||
`build a recent version of clang and LLVM
|
`build a recent version of clang and LLVM
|
||||||
<http://llvm.org/docs/CMake.html>`_.
|
<https://llvm.org/docs/CMake.html>`_.
|
||||||
|
|
||||||
Linkers
|
Linkers
|
||||||
-------
|
-------
|
||||||
@ -59,7 +59,7 @@ ThinLTO is currently supported for the following linkers:
|
|||||||
- **gold (via the gold-plugin)**:
|
- **gold (via the gold-plugin)**:
|
||||||
Similar to monolithic LTO, this requires using
|
Similar to monolithic LTO, this requires using
|
||||||
a `gold linker configured with plugins enabled
|
a `gold linker configured with plugins enabled
|
||||||
<http://llvm.org/docs/GoldPlugin.html>`_.
|
<https://llvm.org/docs/GoldPlugin.html>`_.
|
||||||
- **ld64**:
|
- **ld64**:
|
||||||
Starting with `Xcode 8 <https://developer.apple.com/xcode/>`_.
|
Starting with `Xcode 8 <https://developer.apple.com/xcode/>`_.
|
||||||
- **lld**:
|
- **lld**:
|
||||||
@ -99,7 +99,7 @@ With gold, if you see an error during the link of the form:
|
|||||||
Then either gold was not configured with plugins enabled, or clang
|
Then either gold was not configured with plugins enabled, or clang
|
||||||
was not built with ``-DLLVM_BINUTILS_INCDIR`` set properly. See
|
was not built with ``-DLLVM_BINUTILS_INCDIR`` set properly. See
|
||||||
the instructions for the
|
the instructions for the
|
||||||
`LLVM gold plugin <http://llvm.org/docs/GoldPlugin.html#how-to-build-it>`_.
|
`LLVM gold plugin <https://llvm.org/docs/GoldPlugin.html#how-to-build-it>`_.
|
||||||
|
|
||||||
Controlling Backend Parallelism
|
Controlling Backend Parallelism
|
||||||
-------------------------------
|
-------------------------------
|
||||||
@ -198,9 +198,9 @@ To bootstrap clang/LLVM with ThinLTO, follow these steps:
|
|||||||
|
|
||||||
1. The host compiler_ must be a version of clang that supports ThinLTO.
|
1. The host compiler_ must be a version of clang that supports ThinLTO.
|
||||||
#. The host linker_ must support ThinLTO (and in the case of gold, must be
|
#. The host linker_ must support ThinLTO (and in the case of gold, must be
|
||||||
`configured with plugins enabled <http://llvm.org/docs/GoldPlugin.html>`_.
|
`configured with plugins enabled <https://llvm.org/docs/GoldPlugin.html>`_.
|
||||||
#. Use the following additional `CMake variables
|
#. Use the following additional `CMake variables
|
||||||
<http://llvm.org/docs/CMake.html#options-and-variables>`_
|
<https://llvm.org/docs/CMake.html#options-and-variables>`_
|
||||||
when configuring the bootstrap compiler build:
|
when configuring the bootstrap compiler build:
|
||||||
|
|
||||||
* ``-DLLVM_ENABLE_LTO=Thin``
|
* ``-DLLVM_ENABLE_LTO=Thin``
|
||||||
|
@ -12,7 +12,7 @@ ThreadSanitizer is about **5x-10x**.
|
|||||||
How to build
|
How to build
|
||||||
------------
|
------------
|
||||||
|
|
||||||
Build LLVM/Clang with `CMake <http://llvm.org/docs/CMake.html>`_.
|
Build LLVM/Clang with `CMake <https://llvm.org/docs/CMake.html>`_.
|
||||||
|
|
||||||
Supported Platforms
|
Supported Platforms
|
||||||
-------------------
|
-------------------
|
||||||
|
@ -121,7 +121,7 @@ Clang can be configured to use one of several different linkers:
|
|||||||
* MSVC's link.exe
|
* MSVC's link.exe
|
||||||
|
|
||||||
Link-time optimization is natively supported by lld, and supported via
|
Link-time optimization is natively supported by lld, and supported via
|
||||||
a `linker plugin <http://llvm.org/docs/GoldPlugin.html>`_ when using gold.
|
a `linker plugin <https://llvm.org/docs/GoldPlugin.html>`_ when using gold.
|
||||||
|
|
||||||
The default linker varies between targets, and can be overridden via the
|
The default linker varies between targets, and can be overridden via the
|
||||||
``-fuse-ld=<linker name>`` flag.
|
``-fuse-ld=<linker name>`` flag.
|
||||||
@ -233,7 +233,7 @@ LLVM's unwinder library can be obtained from subversion:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
llvm-src$ svn co http://llvm.org/svn/llvm-project/libunwind/trunk projects/libunwind
|
llvm-src$ svn co https://llvm.org/svn/llvm-project/libunwind/trunk projects/libunwind
|
||||||
|
|
||||||
When checked out into projects/libunwind within an LLVM checkout,
|
When checked out into projects/libunwind within an LLVM checkout,
|
||||||
it should be automatically picked up by the LLVM build system.
|
it should be automatically picked up by the LLVM build system.
|
||||||
|
@ -9,7 +9,7 @@ the different ways to write clang tools, and their pros and cons.
|
|||||||
LibClang
|
LibClang
|
||||||
--------
|
--------
|
||||||
|
|
||||||
`LibClang <http://clang.llvm.org/doxygen/group__CINDEX.html>`_ is a stable high
|
`LibClang <https://clang.llvm.org/doxygen/group__CINDEX.html>`_ is a stable high
|
||||||
level C interface to clang. When in doubt LibClang is probably the interface
|
level C interface to clang. When in doubt LibClang is probably the interface
|
||||||
you want to use. Consider the other interfaces only when you have a good
|
you want to use. Consider the other interfaces only when you have a good
|
||||||
reason not to use LibClang.
|
reason not to use LibClang.
|
||||||
|
@ -25,7 +25,7 @@ The checks have small runtime cost and no impact on address space layout or ABI.
|
|||||||
How to build
|
How to build
|
||||||
============
|
============
|
||||||
|
|
||||||
Build LLVM/Clang with `CMake <http://llvm.org/docs/CMake.html>`_.
|
Build LLVM/Clang with `CMake <https://llvm.org/docs/CMake.html>`_.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
@ -22,7 +22,7 @@ This document describes important notes about using Clang as a compiler
|
|||||||
for an end-user, documenting the supported features, command line
|
for an end-user, documenting the supported features, command line
|
||||||
options, etc. If you are interested in using Clang to build a tool that
|
options, etc. If you are interested in using Clang to build a tool that
|
||||||
processes code, please see :doc:`InternalsManual`. If you are interested in the
|
processes code, please see :doc:`InternalsManual`. If you are interested in the
|
||||||
`Clang Static Analyzer <http://clang-analyzer.llvm.org>`_, please see its web
|
`Clang Static Analyzer <https://clang-analyzer.llvm.org>`_, please see its web
|
||||||
page.
|
page.
|
||||||
|
|
||||||
Clang is one component in a complete toolchain for C family languages.
|
Clang is one component in a complete toolchain for C family languages.
|
||||||
@ -587,7 +587,7 @@ Options to Control Clang Crash Diagnostics
|
|||||||
|
|
||||||
As unbelievable as it may sound, Clang does crash from time to time.
|
As unbelievable as it may sound, Clang does crash from time to time.
|
||||||
Generally, this only occurs to those living on the `bleeding
|
Generally, this only occurs to those living on the `bleeding
|
||||||
edge <http://llvm.org/releases/download.html#svn>`_. Clang goes to great
|
edge <https://llvm.org/releases/download.html#svn>`_. Clang goes to great
|
||||||
lengths to assist you in filing a bug report. Specifically, Clang
|
lengths to assist you in filing a bug report. Specifically, Clang
|
||||||
generates preprocessed source file(s) and associated run script(s) upon
|
generates preprocessed source file(s) and associated run script(s) upon
|
||||||
a crash. These files should be attached to a bug report to ease
|
a crash. These files should be attached to a bug report to ease
|
||||||
@ -982,11 +982,11 @@ Controlling Static Analyzer Diagnostics
|
|||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
While not strictly part of the compiler, the diagnostics from Clang's
|
While not strictly part of the compiler, the diagnostics from Clang's
|
||||||
`static analyzer <http://clang-analyzer.llvm.org>`_ can also be
|
`static analyzer <https://clang-analyzer.llvm.org>`_ can also be
|
||||||
influenced by the user via changes to the source code. See the available
|
influenced by the user via changes to the source code. See the available
|
||||||
`annotations <http://clang-analyzer.llvm.org/annotations.html>`_ and the
|
`annotations <https://clang-analyzer.llvm.org/annotations.html>`_ and the
|
||||||
analyzer's `FAQ
|
analyzer's `FAQ
|
||||||
page <http://clang-analyzer.llvm.org/faq.html#exclude_code>`_ for more
|
page <https://clang-analyzer.llvm.org/faq.html#exclude_code>`_ for more
|
||||||
information.
|
information.
|
||||||
|
|
||||||
.. _usersmanual-precompiled-headers:
|
.. _usersmanual-precompiled-headers:
|
||||||
@ -2158,7 +2158,7 @@ comment(lib)`` are well supported.
|
|||||||
clang has a ``-fms-compatibility`` flag that makes clang accept enough
|
clang has a ``-fms-compatibility`` flag that makes clang accept enough
|
||||||
invalid C++ to be able to parse most Microsoft headers. For example, it
|
invalid C++ to be able to parse most Microsoft headers. For example, it
|
||||||
allows `unqualified lookup of dependent base class members
|
allows `unqualified lookup of dependent base class members
|
||||||
<http://clang.llvm.org/compatibility.html#dep_lookup_bases>`_, which is
|
<https://clang.llvm.org/compatibility.html#dep_lookup_bases>`_, which is
|
||||||
a common compatibility issue with clang. This flag is enabled by default
|
a common compatibility issue with clang. This flag is enabled by default
|
||||||
for Windows targets.
|
for Windows targets.
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ def esc(text):
|
|||||||
text = re.sub(r'>', '>', text)
|
text = re.sub(r'>', '>', text)
|
||||||
def link_if_exists(m):
|
def link_if_exists(m):
|
||||||
name = m.group(1)
|
name = m.group(1)
|
||||||
url = 'http://clang.llvm.org/doxygen/classclang_1_1%s.html' % name
|
url = 'https://clang.llvm.org/doxygen/classclang_1_1%s.html' % name
|
||||||
if url not in doxygen_probes:
|
if url not in doxygen_probes:
|
||||||
try:
|
try:
|
||||||
print 'Probing %s...' % url
|
print 'Probing %s...' % url
|
||||||
|
Loading…
Reference in New Issue
Block a user