diff options
author | Erich Keane <erich.keane@intel.com> | 2017-09-28 20:08:03 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2017-09-28 20:08:03 +0000 |
commit | 84d048779fa39c7719a96474f0f856231fa73780 (patch) | |
tree | 2c07fc6910359091dc72dd17d2ce8a5efebd7b11 /include/clang | |
parent | 2fbd83aec3207a5e8a493170389baa676082e3b5 (diff) | |
download | clang-84d048779fa39c7719a96474f0f856231fa73780.tar.gz |
Add Documentation to attribute-nothrow. Additionally, limit to functions.
Attribute nothrow is only allowed on functions, so I added that. Additionally,
it lacks any documentation, so I added some.
Differential Revision: https://reviews.llvm.org/D38202
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Basic/Attr.td | 3 | ||||
-rw-r--r-- | include/clang/Basic/AttrDocs.td | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index c3567709ee..17d2be2861 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -1437,7 +1437,8 @@ def NotTailCalled : InheritableAttr { def NoThrow : InheritableAttr { let Spellings = [GCC<"nothrow">, Declspec<"nothrow">]; - let Documentation = [Undocumented]; + let Subjects = SubjectList<[Function]>; + let Documentation = [NoThrowDocs]; } def NvWeak : IgnoredAttr { diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index 0500c28386..e51c65073f 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -2727,6 +2727,18 @@ Marking virtual functions as ``not_tail_called`` is an error: }]; } +def NoThrowDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Clang supports the GNU style ``__attribute__((nothrow))`` and Microsoft style +``__declspec(nothrow)`` attribute as an equivilent of `noexcept` on function +declarations. This attribute informs the compiler that the annotated function +does not throw an exception. This prevents exception-unwinding. This attribute +is particularly useful on functions in the C Standard Library that are +guaranteed to not throw an exception. + }]; +} + def InternalLinkageDocs : Documentation { let Category = DocCatFunction; let Content = [{ |