Home | History | Annotate | Download | only in Frontend

Lines Matching defs:Preamble

75     std::string Preamble;
2614 Preamble += "static __NSConstantStringImpl " + S;
2615 Preamble += " __attribute__ ((section (\"__DATA, __cfstring\"))) = {__CFConstantStringClassReference,";
2616 Preamble += "0x000007c8,"; // utf8_str
2621 Preamble += prettyBuf.str();
2622 Preamble += ",";
2623 Preamble += utostr(Exp->getString()->getByteLength()) + "};\n";
5281 Preamble += HF;
6050 RewriteObjCProtocolMetaData(*I, Preamble);
6051 Write_ProtocolExprReferencedMetadata(Context, (*I), Preamble);
6054 InsertText(SM->getLocForStartOfFile(MainFileID), Preamble, false);
6098 Preamble += "#ifndef __OBJC2__\n";
6099 Preamble += "#define __OBJC2__\n";
6100 Preamble += "#endif\n";
6105 Preamble = "#pragma once\n";
6106 Preamble += "struct objc_selector; struct objc_class;\n";
6107 Preamble += "struct __rw_objc_super { \n\tstruct objc_object *object; ";
6108 Preamble += "\n\tstruct objc_object *superClass; ";
6110 Preamble += "\n\t__rw_objc_super(struct objc_object *o, struct objc_object *s) ";
6111 Preamble += ": object(o), superClass(s) {} ";
6112 Preamble += "\n};\n";
6117 Preamble += "\n#pragma section(\".objc_classlist$B\", long, read, write)\n";
6118 Preamble += "#pragma section(\".objc_catlist$B\", long, read, write)\n";
6119 Preamble += "#pragma section(\".objc_imageinfo$B\", long, read, write)\n";
6120 Preamble += "#pragma section(\".objc_nlclslist$B\", long, read, write)\n";
6121 Preamble += "#pragma section(\".objc_nlcatlist$B\", long, read, write)\n";
6123 Preamble += "#pragma section(\".cat_cls_meth$B\", long, read, write)\n";
6124 Preamble += "#pragma section(\".inst_meth$B\", long, read, write)\n";
6125 Preamble += "#pragma section(\".cls_meth$B\", long, read, write)\n";
6126 Preamble += "#pragma section(\".objc_ivar$B\", long, read, write)\n";
6130 Preamble += "#pragma section(\".objc_selrefs$B\", long, read, write)\n";
6131 Preamble += "#pragma section(\".objc_classrefs$B\", long, read, write)\n";
6132 Preamble += "#pragma section(\".objc_superrefs$B\", long, read, write)\n";
6135 Preamble += "#ifndef _REWRITER_typedef_Protocol\n";
6136 Preamble += "typedef struct objc_object Protocol;\n";
6137 Preamble += "#define _REWRITER_typedef_Protocol\n";
6138 Preamble += "#endif\n";
6140 Preamble += "#define __OBJC_RW_DLLIMPORT extern \"C\" __declspec(dllimport)\n";
6141 Preamble += "#define __OBJC_RW_STATICIMPORT extern \"C\"\n";
6144 Preamble += "#define __OBJC_RW_DLLIMPORT extern\n";
6146 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend(void);\n";
6147 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper(void);\n";
6148 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_stret(void);\n";
6149 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper_stret(void);\n";
6150 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_fpret(void);\n";
6152 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getClass";
6153 Preamble += "(const char *);\n";
6154 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *class_getSuperclass";
6155 Preamble += "(struct objc_class *);\n";
6156 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getMetaClass";
6157 Preamble += "(const char *);\n";
6158 Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n";
6160 Preamble += "__OBJC_RW_DLLIMPORT int objc_sync_enter( struct objc_object *);\n";
6161 Preamble += "__OBJC_RW_DLLIMPORT int objc_sync_exit( struct objc_object *);\n";
6162 Preamble += "__OBJC_RW_DLLIMPORT Protocol *objc_getProtocol(const char *);\n";
6163 Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
6164 Preamble += "struct __objcFastEnumerationState {\n\t";
6165 Preamble += "unsigned long state;\n\t";
6166 Preamble += "void **itemsPtr;\n\t";
6167 Preamble += "unsigned long *mutationsPtr;\n\t";
6168 Preamble += "unsigned long extra[5];\n};\n";
6169 Preamble += "__OBJC_RW_DLLIMPORT void objc_enumerationMutation(struct objc_object *);\n";
6170 Preamble += "#define __FASTENUMERATIONSTATE\n";
6171 Preamble += "#endif\n";
6172 Preamble += "#ifndef __NSCONSTANTSTRINGIMPL\n";
6173 Preamble
6174 Preamble += " int *isa;\n";
6175 Preamble += " int flags;\n";
6176 Preamble += " char *str;\n";
6177 Preamble += " long length;\n";
6178 Preamble += "};\n";
6179 Preamble += "#ifdef CF_EXPORT_CONSTANT_STRING\n";
6180 Preamble += "extern \"C\" __declspec(dllexport) int __CFConstantStringClassReference[];\n";
6181 Preamble += "#else\n";
6182 Preamble += "__OBJC_RW_DLLIMPORT int __CFConstantStringClassReference[];\n";
6183 Preamble += "#endif\n";
6184 Preamble += "#define __NSCONSTANTSTRINGIMPL\n";
6185 Preamble += "#endif\n";
6186 // Blocks preamble.
6187 Preamble += "#ifndef BLOCK_IMPL\n";
6188 Preamble += "#define BLOCK_IMPL\n";
6189 Preamble += "struct __block_impl {\n";
6190 Preamble += " void *isa;\n";
6191 Preamble += " int Flags;\n";
6192 Preamble += " int Reserved;\n";
6193 Preamble += " void *FuncPtr;\n";
6194 Preamble += "};\n";
6195 Preamble += "// Runtime copy/destroy helper functions (from Block_private.h)\n";
6196 Preamble += "#ifdef __OBJC_EXPORT_BLOCKS\n";
6197 Preamble += "extern \"C\" __declspec(dllexport) "
6199 Preamble += "extern \"C\" __declspec(dllexport) void _Block_object_dispose(const void *, const int);\n";
6200 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteGlobalBlock[32];\n";
6201 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteStackBlock[32];\n";
6202 Preamble += "#else\n";
6203 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_assign(void *, const void *, const int);\n";
6204 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_dispose(const void *, const int);\n";
6205 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteGlobalBlock[32];\n";
6206 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteStackBlock[32];\n";
6207 Preamble += "#endif\n";
6208 Preamble += "#endif\n";
6210 Preamble += "#undef __OBJC_RW_DLLIMPORT\n";
6211 Preamble += "#undef __OBJC_RW_STATICIMPORT\n";
6212 Preamble += "#ifndef KEEP_ATTRIBUTES\n"; // We use this for clang tests.
6213 Preamble += "#define __attribute__(X)\n";
6214 Preamble += "#endif\n";
6215 Preamble += "#ifndef __weak\n";
6216 Preamble += "#define __weak\n";
6217 Preamble += "#endif\n";
6218 Preamble += "#ifndef __block\n";
6219 Preamble += "#define __block\n";
6220 Preamble += "#endif\n";
6223 Preamble += "#define __block\n";
6224 Preamble += "#define __weak\n";
6228 Preamble += "\n#include <stdarg.h>\n";
6229 Preamble += "struct __NSContainer_literal {\n";
6230 Preamble += " void * *arr;\n";
6231 Preamble += " __NSContainer_literal (unsigned int count, ...) {\n";
6232 Preamble += "\tva_list marker;\n";
6233 Preamble += "\tva_start(marker, count);\n";
6234 Preamble += "\tarr = new void *[count];\n";
6235 Preamble += "\tfor (unsigned i = 0; i < count; i++)\n";
6236 Preamble += "\t arr[i] = va_arg(marker, void *);\n";
6237 Preamble += "\tva_end( marker );\n";
6238 Preamble += " };\n";
6239 Preamble += " ~__NSContainer_literal() {\n";
6240 Preamble += "\tdelete[] arr;\n";
6241 Preamble += " }\n";
6242 Preamble += "};\n";
6245 Preamble += "extern \"C\" __declspec(dllimport) void * objc_autoreleasePoolPush(void);\n";
6246 Preamble += "extern \"C\" __declspec(dllimport) void objc_autoreleasePoolPop(void *);\n\n";
6247 Preamble += "struct __AtAutoreleasePool {\n";
6248 Preamble += " __AtAutoreleasePool() {atautoreleasepoolobj = objc_autoreleasePoolPush();}\n";
6249 Preamble += " ~__AtAutoreleasePool() {objc_autoreleasePoolPop(atautoreleasepoolobj);}\n";
6250 Preamble += " void * atautoreleasepoolobj;\n";
6251 Preamble += "};\n";
6255 Preamble += "\n#define __OFFSETOFIVAR__(TYPE, MEMBER) ((long long) &((TYPE *)0)->MEMBER)\n";