diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-10-22 20:14:27 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-10-22 20:14:27 +0000 |
commit | e892ec7e4645eb0146add15c8ce89e76caeb9539 (patch) | |
tree | b7e6b806205b21c7a0e6e71352cea7a2a787cbed | |
parent | 50bed5e86f749103bc59d5ac1e78555596a4d571 (diff) | |
download | bcm5719-llvm-e892ec7e4645eb0146add15c8ce89e76caeb9539.tar.gz bcm5719-llvm-e892ec7e4645eb0146add15c8ce89e76caeb9539.zip |
Add documentation for calling convention attributes
llvm-svn: 220415
-rw-r--r-- | clang/include/clang/Basic/Attr.td | 10 | ||||
-rw-r--r-- | clang/include/clang/Basic/AttrDocs.td | 74 |
2 files changed, 78 insertions, 6 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index 012988b9327..96699f058a8 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -680,7 +680,7 @@ def FastCall : InheritableAttr { let Spellings = [GCC<"fastcall">, Keyword<"__fastcall">, Keyword<"_fastcall">]; // let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; + let Documentation = [FastCallDocs]; } def Final : InheritableAttr { @@ -779,7 +779,7 @@ def MayAlias : InheritableAttr { def MSABI : InheritableAttr { let Spellings = [GCC<"ms_abi">]; // let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; + let Documentation = [MSABIDocs]; } def MSP430Interrupt : InheritableAttr, TargetSpecificAttr<TargetMSP430> { @@ -1104,7 +1104,7 @@ def Pure : InheritableAttr { def Regparm : TypeAttr { let Spellings = [GCC<"regparm">]; let Args = [UnsignedArgument<"NumParams">]; - let Documentation = [Undocumented]; + let Documentation = [RegparmDocs]; } def ReqdWorkGroupSize : InheritableAttr { @@ -1151,7 +1151,7 @@ def Sentinel : InheritableAttr { def StdCall : InheritableAttr { let Spellings = [GCC<"stdcall">, Keyword<"__stdcall">, Keyword<"_stdcall">]; // let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; + let Documentation = [StdCallDocs]; } def SysVABI : InheritableAttr { @@ -1164,7 +1164,7 @@ def ThisCall : InheritableAttr { let Spellings = [GCC<"thiscall">, Keyword<"__thiscall">, Keyword<"_thiscall">]; // let Subjects = [Function, ObjCMethod]; - let Documentation = [Undocumented]; + let Documentation = [ThisCallDocs]; } def Pascal : InheritableAttr { diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index c72817f9dee..0207ebb084a 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -676,12 +676,84 @@ The semantics are as follows: def PcsDocs : Documentation { let Category = DocCatFunction; let Content = [{ -On ARM targets, this can attribute can be used to select calling conventions, +On ARM targets, this attribute can be used to select calling conventions similar to ``stdcall`` on x86. Valid parameter values are "aapcs" and "aapcs-vfp". }]; } +def RegparmDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +On 32-bit x86 targets, the regparm attribute causes the compiler to pass +the first three integer parameters in EAX, EDX, and ECX instead of on the +stack. This attribute has no effect on variadic functions, and all parameters +are passed via the stack as normal. +}]; +} + +def SysVABIDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +On Windows x86_64 targets, this attribute changes the calling convention of a +function to match the default convention used on Sys V targets such as Linux, +Mac, and BSD. This attribute has no effect on other targets. +}]; +} + +def MSABIDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +On non-Windows x86_64 targets, this attribute changes the calling convention of +a function to match the default convention used on Windows x86_64. This +attribute has no effect on Windows targets or non-x86_64 targets. +}]; +} + +def StdCallDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +On 32-bit x86 targets, this attribute changes the calling convention of a +function to clear parameters off of the stack on return. This convention does +not support variadic calls or unprototyped functions in C, and has no effect on +x86_64 targets. This calling convention is used widely by the Windows API and +COM applications. Documentation for the Visual C++ attribute is available on +MSDN_. + +.. _MSDN: http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx + }]; +} + +def FastCallDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +On 32-bit x86 targets, this attribute changes the calling convention of a +function to use ECX and EDX as register parameters and clear parameters off of +the stack on return. This convention does not support variadic calls or +unprototyped functions in C, and has no effect on x86_64 targets. This calling +convention is supported primarily for compatibility with existing code. Users +seeking register parameters should use the ``regparm`` attribute, which does +not require callee-cleanup. Documentation for the Visual C++ attribute is +available on MSDN_. + +.. _MSDN: http://msdn.microsoft.com/en-us/library/6xa169sk.aspx + }]; +} + +def ThisCallDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +On 32-bit x86 targets, this attribute changes the calling convention of a +function to use ECX for the first parameter (typically the implicit ``this`` +parameter of C++ methods) and clear parameters off of the stack on return. This +convention does not support variadic calls or unprototyped functions in C, and +has no effect on x86_64 targets. Documentation for the Visual C++ attribute is +available on MSDN_. + +.. _MSDN: http://msdn.microsoft.com/en-us/library/ek8tkfbw.aspx + }]; +} + def DocCatConsumed : DocumentationCategory<"Consumed Annotation Checking"> { let Content = [{ Clang supports additional attributes for checking basic resource management |