diff options
author | pfg <pfg@FreeBSD.org> | 2014-01-26 19:49:54 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2014-01-26 19:49:54 +0000 |
commit | fe288f1b72a13316f613e06cd07d4d777cd59b99 (patch) | |
tree | 388002273457e1ebeee9510b9908dc299e3748f1 /contrib/gcc/cp/decl.h | |
parent | 5c96f061e7bff64c2387d5fd90ff095b71ce59b2 (diff) | |
download | FreeBSD-src-fe288f1b72a13316f613e06cd07d4d777cd59b99.zip FreeBSD-src-fe288f1b72a13316f613e06cd07d4d777cd59b99.tar.gz |
MFC r260311, r260831:
gcc: Add support for Apple's Block extension
Block objects [1] are a C-level syntactic and runtime feature. They
are similar to standard C functions, but in addition to executable
code they may also contain variable bindings to automatic (stack)
or managed (heap) memory. A block can therefore maintain a set of
state (data) that it can use to impact behavior when executed.
This port is based on Apple's GCC 5646 with some bugfixes from
Apple GCC 5666.3. It has some small differences with the support
in clang, which remains the recommended compiler.
Perhaps the most notable difference is that in GCC __block is not
actually a keyword, but a macro. There may be workaround for this
issue in the future. Other issues can be consulted in the clang
documentation [2]
For better compatiblity with Apple's GCC and llvm-gcc, some related
fixes and features from Apple have been included. Support for the
non-standard nested functions in GCC is now off by default.
No effort was made to update the ObjC support since FreeBSD doesn't
carry ObjC in the base system but some of the code crept in and
was more difficult to remove than to adjust.
References:
[1]
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
[2]
http://clang.llvm.org/compatibility.html#block-variable-initialization
Obtained from: Apple GCC 4.2
Diffstat (limited to 'contrib/gcc/cp/decl.h')
-rw-r--r-- | contrib/gcc/cp/decl.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/gcc/cp/decl.h b/contrib/gcc/cp/decl.h index dd2357a..179d8a86 100644 --- a/contrib/gcc/cp/decl.h +++ b/contrib/gcc/cp/decl.h @@ -27,6 +27,8 @@ enum decl_context FIELD, /* Declaration inside struct or union */ BITFIELD, /* Likewise but with specified width */ TYPENAME, /* Typename (inside cast or sizeof) */ + /* APPLE LOCAL blocks 6339747 */ + BLOCKDEF, /* Declaratin of block literal */ MEMFUNCDEF /* Member function definition */ }; @@ -34,3 +36,7 @@ enum decl_context extern tree grokdeclarator (const cp_declarator *, const cp_decl_specifier_seq *, enum decl_context, int, tree*); +/* APPLE LOCAL radar 4721858 */ +extern void emit_instantiate_pending_templates (location_t *); +/* APPLE LOCAL blocks 6040305 (ce) */ +extern tree grokparms (cp_parameter_declarator *first_parm, tree *parms); |