summaryrefslogtreecommitdiffstats
path: root/clang/docs
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-02-17 15:27:10 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-02-17 15:27:10 +0000
commit97dba048a3966bb889142fe0bf003dbad8e166cb (patch)
treeadc60f77164232d028ae6318ed7cdd42c68365d2 /clang/docs
parent6774f2241d4108693e602a46925660f2d4d10e1d (diff)
downloadbcm5719-llvm-97dba048a3966bb889142fe0bf003dbad8e166cb.tar.gz
bcm5719-llvm-97dba048a3966bb889142fe0bf003dbad8e166cb.zip
Implements a declarative approach to documenting individual attributes in Clang via a Documentation tablegen class. Also updates the internals manual with information about how to use this new, required, documentation feature.
This patch adds some very, very sparse initial documentation for some attributes. Additional effort from attribute authors is greatly appreciated. llvm-svn: 201515
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/AttributeReference.rst6
-rw-r--r--clang/docs/InternalsManual.rst15
-rw-r--r--clang/docs/index.rst1
3 files changed, 22 insertions, 0 deletions
diff --git a/clang/docs/AttributeReference.rst b/clang/docs/AttributeReference.rst
new file mode 100644
index 00000000000..20aaeec35af
--- /dev/null
+++ b/clang/docs/AttributeReference.rst
@@ -0,0 +1,6 @@
+..
+ -------------------------------------------------------------------
+ NOTE: This file is a placeholder that gets replaced by running
+ clang-tblgen -gen-attr-docs. You should not edit this file by
+ hand, nor should you commit changes to this file.
+ ------------------------------------------------------------------- \ No newline at end of file
diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst
index 96d43ab57dc..a34ba29c21a 100644
--- a/clang/docs/InternalsManual.rst
+++ b/clang/docs/InternalsManual.rst
@@ -1727,6 +1727,21 @@ If additional functionality is desired for the semantic form of the attribute,
the ``AdditionalMembers`` field specifies code to be copied verbatim into the
semantic attribute class object.
+All attributes must have one or more form of documentation, which is provided
+in the ``Documentation`` list. Generally, the documentation for an attribute
+is a stand-alone definition in `include/clang/Basic/AttrDocs.td
+<http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttdDocs.td?view=markup>`_
+that is named after the attribute being documented. Each documentation element
+is given a ``Category`` (variable, function, or type) and ``Content``. A single
+attribute may contain multiple documentation elements for distinct categories.
+For instance, an attribute which can appertain to both function and types (such
+as a calling convention attribute), should contain two documentation elements.
+The ``Content`` for an attribute uses reStructuredText (RST) syntax.
+
+If an attribute is used internally by the compiler, but is not written by users
+(such as attributes with an empty spelling list), it can use the
+``Undocumented`` documentation element.
+
Boilerplate
^^^^^^^^^^^
diff --git a/clang/docs/index.rst b/clang/docs/index.rst
index b18deb9b063..e6c8e31587f 100644
--- a/clang/docs/index.rst
+++ b/clang/docs/index.rst
@@ -9,6 +9,7 @@
:maxdepth: 1
ReleaseNotes
+ AttributeReference
Using Clang as a Compiler
=========================
OpenPOWER on IntegriCloud