Author: erichkeane Date: Thu Aug 31 14:08:24 2017 New Revision: 312281 URL: http://llvm.org/viewvc/llvm-project?rev=312281&view=rev Log: Add documentation for force_align_arg_pointer function attribute
Patch By: anatol.pomozov (anatol.pomo...@gmail.com) Differential Revision: https://reviews.llvm.org/D37312 Modified: cfe/trunk/include/clang/Basic/Attr.td cfe/trunk/include/clang/Basic/AttrDocs.td Modified: cfe/trunk/include/clang/Basic/Attr.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?rev=312281&r1=312280&r2=312281&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/Attr.td (original) +++ cfe/trunk/include/clang/Basic/Attr.td Thu Aug 31 14:08:24 2017 @@ -2043,11 +2043,11 @@ def AnyX86NoCallerSavedRegisters : Inher } def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr<TargetAnyX86> { - let Spellings = [GNU<"force_align_arg_pointer">]; + let Spellings = [GCC<"force_align_arg_pointer">]; // Technically, this appertains to a FunctionDecl, but the target-specific // code silently allows anything function-like (such as typedefs or function // pointers), but does not apply the attribute to them. - let Documentation = [Undocumented]; + let Documentation = [X86ForceAlignArgPointerDocs]; } def NoSanitize : InheritableAttr { Modified: cfe/trunk/include/clang/Basic/AttrDocs.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttrDocs.td?rev=312281&r1=312280&r2=312281&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/AttrDocs.td (original) +++ cfe/trunk/include/clang/Basic/AttrDocs.td Thu Aug 31 14:08:24 2017 @@ -2803,6 +2803,31 @@ For example: }]; } +def X86ForceAlignArgPointerDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Use this attribute to force stack alignment. + +Legacy x86 code uses 4-byte stack alignment. Newer aligned SSE instructions +(like 'movaps') that work with the stack require operands to be 16-byte aligned. +This attribute realigns the stack in the function prologue to make sure the +stack can be used with SSE instructions. + +Note that the x86_64 ABI forces 16-byte stack alignment at the call site. +Because of this, 'force_align_arg_pointer' is not needed on x86_64, except in +rare cases where the caller does not align the stack properly (e.g. flow +jumps from i386 arch code). + + .. code-block:: c + + __attribute__ ((force_align_arg_pointer)) + void f () { + ... + } + + }]; +} + def SwiftCallDocs : Documentation { let Category = DocCatVariable; let Content = [{ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits