Home | History | Annotate | Download | only in Frontend

Lines Matching defs:Preamble

74     std::string Preamble;
2608 Preamble += "static __NSConstantStringImpl " + S;
2609 Preamble += " __attribute__ ((section (\"__DATA, __cfstring\"))) = {__CFConstantStringClassReference,";
2610 Preamble += "0x000007c8,"; // utf8_str
2615 Preamble += prettyBuf.str();
2616 Preamble += ",";
2617 Preamble += utostr(Exp->getString()->getByteLength()) + "};\n";
5213 Preamble += HF;
5981 RewriteObjCProtocolMetaData(*I, Preamble);
5982 Write_ProtocolExprReferencedMetadata(Context, (*I), Preamble);
5985 InsertText(SM->getLocForStartOfFile(MainFileID), Preamble, false);
6029 Preamble += "#ifndef __OBJC2__\n";
6030 Preamble += "#define __OBJC2__\n";
6031 Preamble += "#endif\n";
6036 Preamble = "#pragma once\n";
6037 Preamble += "struct objc_selector; struct objc_class;\n";
6038 Preamble += "struct __rw_objc_super { \n\tstruct objc_object *object; ";
6039 Preamble += "\n\tstruct objc_object *superClass; ";
6041 Preamble += "\n\t__rw_objc_super(struct objc_object *o, struct objc_object *s) ";
6042 Preamble += ": object(o), superClass(s) {} ";
6043 Preamble += "\n};\n";
6048 Preamble += "\n#pragma section(\".objc_classlist$B\", long, read, write)\n";
6049 Preamble += "#pragma section(\".objc_catlist$B\", long, read, write)\n";
6050 Preamble += "#pragma section(\".objc_imageinfo$B\", long, read, write)\n";
6051 Preamble += "#pragma section(\".objc_nlclslist$B\", long, read, write)\n";
6052 Preamble += "#pragma section(\".objc_nlcatlist$B\", long, read, write)\n";
6054 Preamble += "#pragma section(\".cat_cls_meth$B\", long, read, write)\n";
6055 Preamble += "#pragma section(\".inst_meth$B\", long, read, write)\n";
6056 Preamble += "#pragma section(\".cls_meth$B\", long, read, write)\n";
6057 Preamble += "#pragma section(\".objc_ivar$B\", long, read, write)\n";
6061 Preamble += "#pragma section(\".objc_selrefs$B\", long, read, write)\n";
6062 Preamble += "#pragma section(\".objc_classrefs$B\", long, read, write)\n";
6063 Preamble += "#pragma section(\".objc_superrefs$B\", long, read, write)\n";
6066 Preamble += "#ifndef _REWRITER_typedef_Protocol\n";
6067 Preamble += "typedef struct objc_object Protocol;\n";
6068 Preamble += "#define _REWRITER_typedef_Protocol\n";
6069 Preamble += "#endif\n";
6071 Preamble += "#define __OBJC_RW_DLLIMPORT extern \"C\" __declspec(dllimport)\n";
6072 Preamble += "#define __OBJC_RW_STATICIMPORT extern \"C\"\n";
6075 Preamble += "#define __OBJC_RW_DLLIMPORT extern\n";
6077 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend(void);\n";
6078 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper(void);\n";
6079 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_stret(void);\n";
6080 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper_stret(void);\n";
6081 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_fpret(void);\n";
6083 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getClass";
6084 Preamble += "(const char *);\n";
6085 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *class_getSuperclass";
6086 Preamble += "(struct objc_class *);\n";
6087 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getMetaClass";
6088 Preamble += "(const char *);\n";
6089 Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n";
6091 Preamble += "__OBJC_RW_DLLIMPORT int objc_sync_enter( struct objc_object *);\n";
6092 Preamble += "__OBJC_RW_DLLIMPORT int objc_sync_exit( struct objc_object *);\n";
6093 Preamble += "__OBJC_RW_DLLIMPORT Protocol *objc_getProtocol(const char *);\n";
6094 Preamble += "#ifdef _WIN64\n";
6095 Preamble += "typedef unsigned long long _WIN_NSUInteger;\n";
6096 Preamble += "#else\n";
6097 Preamble += "typedef unsigned int _WIN_NSUInteger;\n";
6098 Preamble += "#endif\n";
6099 Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
6100 Preamble += "struct __objcFastEnumerationState {\n\t";
6101 Preamble += "unsigned long state;\n\t";
6102 Preamble += "void **itemsPtr;\n\t";
6103 Preamble += "unsigned long *mutationsPtr;\n\t";
6104 Preamble += "unsigned long extra[5];\n};\n";
6105 Preamble += "__OBJC_RW_DLLIMPORT void objc_enumerationMutation(struct objc_object *);\n";
6106 Preamble += "#define __FASTENUMERATIONSTATE\n";
6107 Preamble += "#endif\n";
6108 Preamble += "#ifndef __NSCONSTANTSTRINGIMPL\n";
6109 Preamble += "struct __NSConstantStringImpl {\n";
6110 Preamble += " int *isa;\n";
6111 Preamble += " int flags;\n";
6112 Preamble += " char *str;\n";
6113 Preamble += "#if _WIN64\n";
6114 Preamble += " long long length;\n";
6115 Preamble += "#else\n";
6116 Preamble += " long length;\n";
6117 Preamble += "#endif\n";
6118 Preamble += "};\n";
6119 Preamble += "#ifdef CF_EXPORT_CONSTANT_STRING\n";
6120 Preamble += "extern \"C\" __declspec(dllexport) int __CFConstantStringClassReference[];\n";
6121 Preamble += "#else\n";
6122 Preamble += "__OBJC_RW_DLLIMPORT int __CFConstantStringClassReference[];\n";
6123 Preamble += "#endif\n";
6124 Preamble += "#define __NSCONSTANTSTRINGIMPL\n";
6125 Preamble += "#endif\n";
6126 // Blocks preamble.
6127 Preamble += "#ifndef BLOCK_IMPL\n";
6128 Preamble += "#define BLOCK_IMPL\n";
6129 Preamble += "struct __block_impl {\n";
6130 Preamble += " void *isa;\n";
6131 Preamble += " int Flags;\n";
6132 Preamble += " int Reserved;\n";
6133 Preamble += " void *FuncPtr;\n";
6134 Preamble += "};\n";
6135 Preamble += "// Runtime copy/destroy helper functions (from Block_private.h)\n";
6136 Preamble += "#ifdef __OBJC_EXPORT_BLOCKS\n";
6137 Preamble += "extern \"C\" __declspec(dllexport) "
6139 Preamble += "extern \"C\" __declspec(dllexport) void _Block_object_dispose(const void *, const int);\n";
6140 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteGlobalBlock[32];\n";
6141 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteStackBlock[32];\n";
6142 Preamble += "#else\n";
6143 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_assign(void *, const void *, const int);\n";
6144 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_dispose(const void *, const int);\n";
6145 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteGlobalBlock[32];\n";
6146 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteStackBlock[32];\n";
6147 Preamble += "#endif\n";
6148 Preamble += "#endif\n";
6150 Preamble += "#undef __OBJC_RW_DLLIMPORT\n";
6151 Preamble += "#undef __OBJC_RW_STATICIMPORT\n";
6152 Preamble += "#ifndef KEEP_ATTRIBUTES\n"; // We use this for clang tests.
6153 Preamble += "#define __attribute__(X)\n";
6154 Preamble += "#endif\n";
6155 Preamble += "#ifndef __weak\n";
6156 Preamble += "#define __weak\n";
6157 Preamble += "#endif\n";
6158 Preamble += "#ifndef __block\n";
6159 Preamble += "#define __block\n";
6160 Preamble += "#endif\n";
6163 Preamble += "#define __block\n";
6164 Preamble += "#define __weak\n";
6168 Preamble += "\n#include <stdarg.h>\n";
6169 Preamble += "struct __NSContainer_literal {\n";
6170 Preamble += " void * *arr;\n";
6171 Preamble += " __NSContainer_literal (unsigned int count, ...) {\n";
6172 Preamble += "\tva_list marker;\n";
6173 Preamble += "\tva_start(marker, count);\n";
6174 Preamble += "\tarr = new void *[count];\n";
6175 Preamble += "\tfor (unsigned i = 0; i < count; i++)\n";
6176 Preamble += "\t arr[i] = va_arg(marker, void *);\n";
6177 Preamble += "\tva_end( marker );\n";
6178 Preamble += " };\n";
6179 Preamble += " ~__NSContainer_literal() {\n";
6180 Preamble += "\tdelete[] arr;\n";
6181 Preamble += " }\n";
6182 Preamble += "};\n";
6185 Preamble += "extern \"C\" __declspec(dllimport) void * objc_autoreleasePoolPush(void);\n";
6186 Preamble += "extern \"C\" __declspec(dllimport) void objc_autoreleasePoolPop(void *);\n\n";
6187 Preamble += "struct __AtAutoreleasePool {\n";
6188 Preamble += " __AtAutoreleasePool() {atautoreleasepoolobj = objc_autoreleasePoolPush();}\n";
6189 Preamble += " ~__AtAutoreleasePool() {objc_autoreleasePoolPop(atautoreleasepoolobj);}\n";
6190 Preamble += " void * atautoreleasepoolobj;\n";
6191 Preamble += "};\n";
6195 Preamble += "\n#define __OFFSETOFIVAR__(TYPE, MEMBER) ((long long) &((TYPE *)0)->MEMBER)\n";