diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-10 13:44:22 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-10 13:44:22 +0000 |
| commit | 1b08b196ac845675036ac78f3ac927d0a37f707c (patch) | |
| tree | 1fbd923674e903831dc097fdb4fdfd64dd6e47b1 /docs | |
| parent | 551c698530debaae81139c7c76a29fb762793362 (diff) | |
Notes
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ClangFormatStyleOptions.rst | 2 | ||||
| -rw-r--r-- | docs/LanguageExtensions.rst | 42 | ||||
| -rw-r--r-- | docs/LibASTMatchersReference.html | 102 |
3 files changed, 128 insertions, 18 deletions
diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst index f54acd9b81dd5..9e0bacaf7c14a 100644 --- a/docs/ClangFormatStyleOptions.rst +++ b/docs/ClangFormatStyleOptions.rst @@ -894,7 +894,7 @@ the configuration (without a prefix: ``Auto``). ? firstValue : SecondValueVeryVeryVeryVeryLong; - true: + false: veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription ? firstValue : SecondValueVeryVeryVeryVeryLong; diff --git a/docs/LanguageExtensions.rst b/docs/LanguageExtensions.rst index f8dd1a39c6761..dab538f3a9834 100644 --- a/docs/LanguageExtensions.rst +++ b/docs/LanguageExtensions.rst @@ -2521,3 +2521,45 @@ whether or not an attribute is supported by the pragma by referring to the The attributes are applied to all matching declarations individually, even when the attribute is semantically incorrect. The attributes that aren't applied to any declaration are not verified semantically. + +Specifying section names for global objects (#pragma clang section) +=================================================================== + +The ``#pragma clang section`` directive provides a means to assign section-names +to global variables, functions and static variables. + +The section names can be specified as: + +.. code-block:: c++ + + #pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText" + +The section names can be reverted back to default name by supplying an empty +string to the section kind, for example: + +.. code-block:: c++ + + #pragma clang section bss="" data="" text="" rodata="" + +The ``#pragma clang section`` directive obeys the following rules: + +* The pragma applies to all global variable, statics and function declarations + from the pragma to the end of the translation unit. + +* The pragma clang section is enabled automatically, without need of any flags. + +* This feature is only defined to work sensibly for ELF targets. + +* If section name is specified through _attribute_((section("myname"))), then + the attribute name gains precedence. + +* Global variables that are initialized to zero will be placed in the named + bss section, if one is present. + +* The ``#pragma clang section`` directive does not does try to infer section-kind + from the name. For example, naming a section "``.bss.mySec``" does NOT mean + it will be a bss section name. + +* The decision about which section-kind applies to each global is taken in the back-end. + Once the section-kind is known, appropriate section name, as specified by the user using + ``#pragma clang section`` directive, is applied to that global. diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index c91b2a2490290..a0403a5edf652 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -1859,17 +1859,36 @@ Example matches a || b (matcher = binaryOperator(hasOperatorName("||"))) </pre></td></tr> -<tr><td>Matcher<CXXBoolLiteral></td><td class="name" onclick="toggle('equals2')"><a name="equals2Anchor">equals</a></td><td>ValueT Value</td></tr> -<tr><td colspan="4" class="doc" id="equals2"><pre>Matches literals that are equal to the given value. +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals2')"><a name="equals2Anchor">equals</a></td><td>ValueT Value</td></tr> +<tr><td colspan="4" class="doc" id="equals2"><pre>Matches literals that are equal to the given value of type ValueT. -Example matches true (matcher = cxxBoolLiteral(equals(true))) - true +Given + f('false, 3.14, 42); +characterLiteral(equals(0)) + matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0)) + match false +floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2)) + match 3.14 +integerLiteral(equals(42)) + matches 42 -Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>, +Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>> </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals5')"><a name="equals5Anchor">equals</a></td><td>bool Value</td></tr> +<tr><td colspan="4" class="doc" id="equals5"><pre></pre></td></tr> + + +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals11')"><a name="equals11Anchor">equals</a></td><td>double Value</td></tr> +<tr><td colspan="4" class="doc" id="equals11"><pre></pre></td></tr> + + +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals8')"><a name="equals8Anchor">equals</a></td><td>unsigned Value</td></tr> +<tr><td colspan="4" class="doc" id="equals8"><pre></pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCatchStmt.html">CXXCatchStmt</a>></td><td class="name" onclick="toggle('isCatchAll0')"><a name="isCatchAll0Anchor">isCatchAll</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isCatchAll0"><pre>Matches a C++ catch statement that has a catch-all handler. @@ -2296,16 +2315,35 @@ Example: matches the implicit cast around 0 <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals3')"><a name="equals3Anchor">equals</a></td><td>ValueT Value</td></tr> -<tr><td colspan="4" class="doc" id="equals3"><pre>Matches literals that are equal to the given value. +<tr><td colspan="4" class="doc" id="equals3"><pre>Matches literals that are equal to the given value of type ValueT. -Example matches true (matcher = cxxBoolLiteral(equals(true))) - true +Given + f('false, 3.14, 42); +characterLiteral(equals(0)) + matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0)) + match false +floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2)) + match 3.14 +integerLiteral(equals(42)) + matches 42 -Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>, +Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>> </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals4')"><a name="equals4Anchor">equals</a></td><td>bool Value</td></tr> +<tr><td colspan="4" class="doc" id="equals4"><pre></pre></td></tr> + + +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals10')"><a name="equals10Anchor">equals</a></td><td>double Value</td></tr> +<tr><td colspan="4" class="doc" id="equals10"><pre></pre></td></tr> + + +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals7')"><a name="equals7Anchor">equals</a></td><td>unsigned Value</td></tr> +<tr><td colspan="4" class="doc" id="equals7"><pre></pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('templateArgumentCountIs0')"><a name="templateArgumentCountIs0Anchor">templateArgumentCountIs</a></td><td>unsigned N</td></tr> <tr><td colspan="4" class="doc" id="templateArgumentCountIs0"><pre>Matches if the number of template arguments equals N. @@ -2533,16 +2571,27 @@ fieldDecl(isBitField()) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals1')"><a name="equals1Anchor">equals</a></td><td>ValueT Value</td></tr> -<tr><td colspan="4" class="doc" id="equals1"><pre>Matches literals that are equal to the given value. +<tr><td colspan="4" class="doc" id="equals1"><pre>Matches literals that are equal to the given value of type ValueT. -Example matches true (matcher = cxxBoolLiteral(equals(true))) - true +Given + f('false, 3.14, 42); +characterLiteral(equals(0)) + matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0)) + match false +floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2)) + match 3.14 +integerLiteral(equals(42)) + matches 42 -Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>, +Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>> </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals12')"><a name="equals12Anchor">equals</a></td><td>double Value</td></tr> +<tr><td colspan="4" class="doc" id="equals12"><pre></pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasDynamicExceptionSpec0')"><a name="hasDynamicExceptionSpec0Anchor">hasDynamicExceptionSpec</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="hasDynamicExceptionSpec0"><pre>Matches functions that have a dynamic exception specification. @@ -2805,16 +2854,35 @@ functionProtoType(parameterCountIs(3)) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals0')"><a name="equals0Anchor">equals</a></td><td>ValueT Value</td></tr> -<tr><td colspan="4" class="doc" id="equals0"><pre>Matches literals that are equal to the given value. +<tr><td colspan="4" class="doc" id="equals0"><pre>Matches literals that are equal to the given value of type ValueT. -Example matches true (matcher = cxxBoolLiteral(equals(true))) - true +Given + f('false, 3.14, 42); +characterLiteral(equals(0)) + matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0)) + match false +floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2)) + match 3.14 +integerLiteral(equals(42)) + matches 42 -Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>, +Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>> </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals6')"><a name="equals6Anchor">equals</a></td><td>bool Value</td></tr> +<tr><td colspan="4" class="doc" id="equals6"><pre></pre></td></tr> + + +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals13')"><a name="equals13Anchor">equals</a></td><td>double Value</td></tr> +<tr><td colspan="4" class="doc" id="equals13"><pre></pre></td></tr> + + +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals9')"><a name="equals9Anchor">equals</a></td><td>unsigned Value</td></tr> +<tr><td colspan="4" class="doc" id="equals9"><pre></pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('isArrow0')"><a name="isArrow0Anchor">isArrow</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isArrow0"><pre>Matches member expressions that are called with '->' as opposed to '.'. |
