Skip to content

Commit

Permalink
[NFC][analyzer][docs] Migrate 'annotations.html' to RST (llvm#122246)
Browse files Browse the repository at this point in the history
This commit migrates the contents of 'annotations.html' in the old
HTML-based documentation of the Clang static analyzer to the new
RST-based documentation.

During this conversion I reordered the sections of this documentation
file by placing the section "Custom Assertion Handlers" as a subsection
of "Annotations to Enhance Generic Checks". (The primary motivation was
that Sphinx complained about inconsistent section levels; with this
change I preserved that sections describing individual annotations are
all on the same level.)

Apart from this change and the format conversion, I didn't review,
validate or edit the contents of this documentation file because I think
it would be better to place any additional changes in separate commits.
  • Loading branch information
NagyDonat authored and DKLoehr committed Jan 17, 2025
1 parent eb2eb97 commit e84b9bb
Show file tree
Hide file tree
Showing 10 changed files with 708 additions and 770 deletions.
8 changes: 4 additions & 4 deletions clang/docs/LanguageExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2137,8 +2137,8 @@ method; it specifies that the method expects its ``self`` parameter to have a
- (void) bar __attribute__((ns_consumes_self));
- (void) baz:(id) __attribute__((ns_consumed)) x;
Further examples of these attributes are available in the static analyzer's `list of annotations for analysis
<https://clang-analyzer.llvm.org/annotations.html#cocoa_mem>`_.
Further examples of these attributes are available in the static analyzer's
`list of annotations for analysis <analyzer/user-docs/Annotations.html#cocoa-mem>`__.
Query for these features with ``__has_attribute(ns_consumed)``,
``__has_attribute(ns_returns_retained)``, etc.
Expand Down Expand Up @@ -4792,8 +4792,8 @@ Extensions for Static Analysis
Clang supports additional attributes that are useful for documenting program
invariants and rules for static analysis tools, such as the `Clang Static
Analyzer <https://clang-analyzer.llvm.org/>`_. These attributes are documented
in the analyzer's `list of source-level annotations
<https://clang-analyzer.llvm.org/annotations.html>`_.
in the analyzer's `list of annotations for analysis
<analyzer/user-docs/Annotations.html>`__.
Extensions for Dynamic Analysis
Expand Down
6 changes: 2 additions & 4 deletions clang/docs/UsersManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1364,10 +1364,8 @@ Controlling Static Analyzer Diagnostics
While not strictly part of the compiler, the diagnostics from Clang's
`static analyzer <https://clang-analyzer.llvm.org>`_ can also be
influenced by the user via changes to the source code. See the available
`annotations <https://clang-analyzer.llvm.org/annotations.html>`_ and the
analyzer's `FAQ
page <https://clang-analyzer.llvm.org/faq.html#exclude_code>`_ for more
information.
`annotations <analyzer/user-docs/Annotations.html>`_ and the analyzer's
`FAQ page <analyzer/user-docs/FAQ.html#exclude-code>`_ for more information.

.. _usersmanual-precompiled-headers:

Expand Down
1 change: 1 addition & 0 deletions clang/docs/analyzer/user-docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ Contents:
user-docs/FilingBugs
user-docs/CrossTranslationUnit
user-docs/TaintAnalysisConfiguration
user-docs/Annotations
user-docs/FAQ
Loading

0 comments on commit e84b9bb

Please sign in to comment.