xref: /freebsd-src/contrib/llvm-project/compiler-rt/lib/BlocksRuntime/data.c (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric /*
2*0b57cec5SDimitry Andric  * data.c
3*0b57cec5SDimitry Andric  *
4*0b57cec5SDimitry Andric  * Copyright 2008-2010 Apple, Inc. Permission is hereby granted, free of charge,
5*0b57cec5SDimitry Andric  * to any person obtaining a copy of this software and associated documentation
6*0b57cec5SDimitry Andric  * files (the "Software"), to deal in the Software without restriction,
7*0b57cec5SDimitry Andric  * including without limitation the rights to use, copy, modify, merge, publish,
8*0b57cec5SDimitry Andric  * distribute, sublicense, and/or sell copies of the Software, and to permit
9*0b57cec5SDimitry Andric  * persons to whom the Software is furnished to do so, subject to the following
10*0b57cec5SDimitry Andric  * conditions:
11*0b57cec5SDimitry Andric  *
12*0b57cec5SDimitry Andric  * The above copyright notice and this permission notice shall be included in
13*0b57cec5SDimitry Andric  * all copies or substantial portions of the Software.
14*0b57cec5SDimitry Andric  *
15*0b57cec5SDimitry Andric  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*0b57cec5SDimitry Andric  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*0b57cec5SDimitry Andric  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18*0b57cec5SDimitry Andric  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*0b57cec5SDimitry Andric  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20*0b57cec5SDimitry Andric  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21*0b57cec5SDimitry Andric  * SOFTWARE.
22*0b57cec5SDimitry Andric  *
23*0b57cec5SDimitry Andric  */
24*0b57cec5SDimitry Andric 
25*0b57cec5SDimitry Andric /********************
26*0b57cec5SDimitry Andric NSBlock support
27*0b57cec5SDimitry Andric 
28*0b57cec5SDimitry Andric We allocate space and export a symbol to be used as the Class for the on-stack and malloc'ed copies until ObjC arrives on the scene.  These data areas are set up by Foundation to link in as real classes post facto.
29*0b57cec5SDimitry Andric 
30*0b57cec5SDimitry Andric We keep these in a separate file so that we can include the runtime code in test subprojects but not include the data so that compiled code that sees the data in libSystem doesn't get confused by a second copy.  Somehow these don't get unified in a common block.
31*0b57cec5SDimitry Andric **********************/
32*0b57cec5SDimitry Andric 
33*0b57cec5SDimitry Andric void * _NSConcreteStackBlock[32] = { 0 };
34*0b57cec5SDimitry Andric void * _NSConcreteMallocBlock[32] = { 0 };
35*0b57cec5SDimitry Andric void * _NSConcreteAutoBlock[32] = { 0 };
36*0b57cec5SDimitry Andric void * _NSConcreteFinalizingBlock[32] = { 0 };
37*0b57cec5SDimitry Andric void * _NSConcreteGlobalBlock[32] = { 0 };
38*0b57cec5SDimitry Andric void * _NSConcreteWeakBlockVariable[32] = { 0 };
39*0b57cec5SDimitry Andric 
_Block_copy_error(void)40*0b57cec5SDimitry Andric void _Block_copy_error(void) {
41*0b57cec5SDimitry Andric }
42