diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2013-07-26 00:53:29 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2013-07-26 00:53:29 +0000 |
| commit | f24bd3bdba33297223f2dcbc3bcfae8b844a69e2 (patch) | |
| tree | 5b60b3db937133c78fa8301492abd8e026196c34 /clang/docs | |
| parent | a7d4822c7585a9d9d0435fcfcb6067370b9d00b3 (diff) | |
| download | bcm5719-llvm-f24bd3bdba33297223f2dcbc3bcfae8b844a69e2.tar.gz bcm5719-llvm-f24bd3bdba33297223f2dcbc3bcfae8b844a69e2.zip | |
Fix GNU ObjC ABI for a message returning a struct.
This allows the ObjFW runtime to correctly implement message forwarding
for messages which return a struct.
Patch by Jonathan Schleifer.
llvm-svn: 187174
Diffstat (limited to 'clang/docs')
| -rw-r--r-- | clang/docs/LanguageExtensions.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst index 1917e2b73c2..e8826b5b360 100644 --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -1255,6 +1255,23 @@ Further examples of these attributes are available in the static analyzer's `lis Query for these features with ``__has_attribute(ns_consumed)``, ``__has_attribute(ns_returns_retained)``, etc. +objc_msg_lookup_stret +--------------------- + +Traditionally, if a runtime is used that follows the GNU Objective-C ABI, a +call to objc_msg_lookup() would be emitted for each message send, which would +return a pointer to the actual implementation of the method. However, +objc_msg_lookup() has no information at all about the method signature of the +actual method. Therefore, certain features like forwarding messages cannot be +correctly implemented for methods returning structs using objc_msg_lookup(), as +methods returning structs use a slightly different calling convention. + +To work around this, Clang emits calls to objc_msg_lookup_stret() instead for +methods that return structs if the runtime supports this, allowing the runtime +to use a different forwarding handler for methods returning structs. + +To check if Clang emits calls to objc_msg_lookup_stret(), +__has_feature(objc_msg_lookup_stret) can be used. Function Overloading in C ========================= |

