diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2017-07-21 08:10:57 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2017-07-21 08:10:57 +0000 |
| commit | d5c937b3a352b73f5198efd3e9292ffd88903202 (patch) | |
| tree | 1d1b017458dba6d035e51b5b83ebe76f82e99869 /clang/include | |
| parent | 2b13913b12fe35c8ad0abee8e713ef3942222795 (diff) | |
| download | bcm5719-llvm-d5c937b3a352b73f5198efd3e9292ffd88903202.tar.gz bcm5719-llvm-d5c937b3a352b73f5198efd3e9292ffd88903202.zip | |
[mips] Add `short_call` to the set of `long_call/far/near` attributes
MIPS gcc supports `long_call/far/near` attributes only, but other
targets have the `short_call` attribut, so let's support it for MIPS
for consistency.
llvm-svn: 308719
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/Basic/Attr.td | 2 | ||||
| -rw-r--r-- | clang/include/clang/Basic/AttrDocs.td | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index 5fd6b55e439..f8d06e24b15 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -1195,7 +1195,7 @@ def MipsLongCall : InheritableAttr, TargetSpecificAttr<TargetMips> { } def MipsShortCall : InheritableAttr, TargetSpecificAttr<TargetMips> { - let Spellings = [GCC<"near">]; + let Spellings = [GCC<"short_call">, GCC<"near">]; let Subjects = SubjectList<[Function]>; let Documentation = [MipsShortCallStyleDocs]; } diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index 5c05f2cccb0..06b89f1dc66 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -1348,13 +1348,14 @@ def MipsShortCallStyleDocs : Documentation { let Category = DocCatFunction; let Content = [{ Clang supports the ``__attribute__((long_call))``, ``__attribute__((far))``, -and ``__attribute__((near))`` attributes on MIPS targets. These attributes may -only be added to function declarations and change the code generated -by the compiler when directly calling the function. The ``near`` attribute -allows calls to the function to be made using the ``jal`` instruction, which -requires the function to be located in the same naturally aligned 256MB -segment as the caller. The ``long_call`` and ``far`` attributes are synonyms -and require the use of a different call sequence that works regardless +``__attribute__((short__call))``, and ``__attribute__((near))`` attributes +on MIPS targets. These attributes may only be added to function declarations +and change the code generated by the compiler when directly calling +the function. The ``short_call`` and ``near`` attributes are synonyms and +allow calls to the function to be made using the ``jal`` instruction, which +requires the function to be located in the same naturally aligned 256MB segment +as the caller. The ``long_call`` and ``far`` attributes are synonyms and +require the use of a different call sequence that works regardless of the distance between the functions. These attributes have no effect for position-independent code. |

