Lines Matching full:preamble
77 std::string Preamble;
2576 Preamble += "static __NSConstantStringImpl " + S;
2577 Preamble += " __attribute__ ((section (\"__DATA, __cfstring\"))) = {__CFConstantStringClassReference,";
2578 Preamble += "0x000007c8,"; // utf8_str
2583 Preamble += prettyBufS;
2584 Preamble += ",";
2585 Preamble += utostr(Exp->getString()->getByteLength()) + "};\n";
5070 Preamble += HF;
5838 RewriteObjCProtocolMetaData(ProtDecl, Preamble);
5839 Write_ProtocolExprReferencedMetadata(Context, ProtDecl, Preamble);
5842 InsertText(SM->getLocForStartOfFile(MainFileID), Preamble, false);
5886 Preamble += "#ifndef __OBJC2__\n";
5887 Preamble += "#define __OBJC2__\n";
5888 Preamble += "#endif\n";
5893 Preamble = "#pragma once\n";
5894 Preamble += "struct objc_selector; struct objc_class;\n";
5895 Preamble += "struct __rw_objc_super { \n\tstruct objc_object *object; ";
5896 Preamble += "\n\tstruct objc_object *superClass; ";
5898 Preamble += "\n\t__rw_objc_super(struct objc_object *o, struct objc_object *s) ";
5899 Preamble += ": object(o), superClass(s) {} ";
5900 Preamble += "\n};\n";
5905 Preamble += "\n#pragma section(\".objc_classlist$B\", long, read, write)\n";
5906 Preamble += "#pragma section(\".objc_catlist$B\", long, read, write)\n";
5907 Preamble += "#pragma section(\".objc_imageinfo$B\", long, read, write)\n";
5908 Preamble += "#pragma section(\".objc_nlclslist$B\", long, read, write)\n";
5909 Preamble += "#pragma section(\".objc_nlcatlist$B\", long, read, write)\n";
5911 Preamble += "#pragma section(\".cat_cls_meth$B\", long, read, write)\n";
5912 Preamble += "#pragma section(\".inst_meth$B\", long, read, write)\n";
5913 Preamble += "#pragma section(\".cls_meth$B\", long, read, write)\n";
5914 Preamble += "#pragma section(\".objc_ivar$B\", long, read, write)\n";
5918 Preamble += "#pragma section(\".objc_selrefs$B\", long, read, write)\n";
5919 Preamble += "#pragma section(\".objc_classrefs$B\", long, read, write)\n";
5920 Preamble += "#pragma section(\".objc_superrefs$B\", long, read, write)\n";
5923 Preamble += "#ifndef _REWRITER_typedef_Protocol\n";
5924 Preamble += "typedef struct objc_object Protocol;\n";
5925 Preamble += "#define _REWRITER_typedef_Protocol\n";
5926 Preamble += "#endif\n";
5928 Preamble += "#define __OBJC_RW_DLLIMPORT extern \"C\" __declspec(dllimport)\n";
5929 Preamble += "#define __OBJC_RW_STATICIMPORT extern \"C\"\n";
5932 Preamble += "#define __OBJC_RW_DLLIMPORT extern\n";
5934 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend(void);\n";
5935 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper(void);\n";
5936 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_stret(void);\n";
5937 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper_stret(void);\n";
5938 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_fpret(void);\n";
5940 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getClass";
5941 Preamble += "(const char *);\n";
5942 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *class_getSuperclass";
5943 Preamble += "(struct objc_class *);\n";
5944 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *objc_getMetaClass";
5945 Preamble += "(const char *);\n";
5946 Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n";
5948 Preamble += "__OBJC_RW_DLLIMPORT int objc_sync_enter( struct objc_object *);\n";
5949 Preamble += "__OBJC_RW_DLLIMPORT int objc_sync_exit( struct objc_object *);\n";
5950 Preamble += "__OBJC_RW_DLLIMPORT Protocol *objc_getProtocol(const char *);\n";
5951 Preamble += "#ifdef _WIN64\n";
5952 Preamble += "typedef unsigned long long _WIN_NSUInteger;\n";
5953 Preamble += "#else\n";
5954 Preamble += "typedef unsigned int _WIN_NSUInteger;\n";
5955 Preamble += "#endif\n";
5956 Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
5957 Preamble += "struct __objcFastEnumerationState {\n\t";
5958 Preamble += "unsigned long state;\n\t";
5959 Preamble += "void **itemsPtr;\n\t";
5960 Preamble += "unsigned long *mutationsPtr;\n\t";
5961 Preamble += "unsigned long extra[5];\n};\n";
5962 Preamble += "__OBJC_RW_DLLIMPORT void objc_enumerationMutation(struct objc_object *);\n";
5963 Preamble += "#define __FASTENUMERATIONSTATE\n";
5964 Preamble += "#endif\n";
5965 Preamble += "#ifndef __NSCONSTANTSTRINGIMPL\n";
5966 Preamble += "struct __NSConstantStringImpl {\n";
5967 Preamble += " int *isa;\n";
5968 Preamble += " int flags;\n";
5969 Preamble += " char *str;\n";
5970 Preamble += "#if _WIN64\n";
5971 Preamble += " long long length;\n";
5972 Preamble += "#else\n";
5973 Preamble += " long length;\n";
5974 Preamble += "#endif\n";
5975 Preamble += "};\n";
5976 Preamble += "#ifdef CF_EXPORT_CONSTANT_STRING\n";
5977 Preamble += "extern \"C\" __declspec(dllexport) int __CFConstantStringClassReference[];\n";
5978 Preamble += "#else\n";
5979 Preamble += "__OBJC_RW_DLLIMPORT int __CFConstantStringClassReference[];\n";
5980 Preamble += "#endif\n";
5981 Preamble += "#define __NSCONSTANTSTRINGIMPL\n";
5982 Preamble += "#endif\n";
5983 // Blocks preamble.
5984 Preamble += "#ifndef BLOCK_IMPL\n";
5985 Preamble += "#define BLOCK_IMPL\n";
5986 Preamble += "struct __block_impl {\n";
5987 Preamble += " void *isa;\n";
5988 Preamble += " int Flags;\n";
5989 Preamble += " int Reserved;\n";
5990 Preamble += " void *FuncPtr;\n";
5991 Preamble += "};\n";
5992 Preamble += "// Runtime copy/destroy helper functions (from Block_private.h)\n";
5993 Preamble += "#ifdef __OBJC_EXPORT_BLOCKS\n";
5994 Preamble += "extern \"C\" __declspec(dllexport) "
5996 Preamble += "extern \"C\" __declspec(dllexport) void _Block_object_dispose(const void *, const int);\n";
5997 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteGlobalBlock[32];\n";
5998 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteStackBlock[32];\n";
5999 Preamble += "#else\n";
6000 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_assign(void *, const void *, const int);\n";
6001 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_dispose(const void *, const int);\n";
6002 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteGlobalBlock[32];\n";
6003 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteStackBlock[32];\n";
6004 Preamble += "#endif\n";
6005 Preamble += "#endif\n";
6007 Preamble += "#undef __OBJC_RW_DLLIMPORT\n";
6008 Preamble += "#undef __OBJC_RW_STATICIMPORT\n";
6009 Preamble += "#ifndef KEEP_ATTRIBUTES\n"; // We use this for clang tests.
6010 Preamble += "#define __attribute__(X)\n";
6011 Preamble += "#endif\n";
6012 Preamble += "#ifndef __weak\n";
6013 Preamble += "#define __weak\n";
6014 Preamble += "#endif\n";
6015 Preamble += "#ifndef __block\n";
6016 Preamble += "#define __block\n";
6017 Preamble += "#endif\n";
6020 Preamble += "#define __block\n";
6021 Preamble += "#define __weak\n";
6025 Preamble += "\n#include <stdarg.h>\n";
6026 Preamble += "struct __NSContainer_literal {\n";
6027 Preamble += " void * *arr;\n";
6028 Preamble += " __NSContainer_literal (unsigned int count, ...) {\n";
6029 Preamble += "\tva_list marker;\n";
6030 Preamble += "\tva_start(marker, count);\n";
6031 Preamble += "\tarr = new void *[count];\n";
6032 Preamble += "\tfor (unsigned i = 0; i < count; i++)\n";
6033 Preamble += "\t arr[i] = va_arg(marker, void *);\n";
6034 Preamble += "\tva_end( marker );\n";
6035 Preamble += " };\n";
6036 Preamble += " ~__NSContainer_literal() {\n";
6037 Preamble += "\tdelete[] arr;\n";
6038 Preamble += " }\n";
6039 Preamble += "};\n";
6042 Preamble += "extern \"C\" __declspec(dllimport) void * objc_autoreleasePoolPush(void);\n";
6043 Preamble += "extern \"C\" __declspec(dllimport) void objc_autoreleasePoolPop(void *);\n\n";
6044 Preamble += "struct __AtAutoreleasePool {\n";
6045 Preamble += " __AtAutoreleasePool() {atautoreleasepoolobj = objc_autoreleasePoolPush();}\n";
6046 Preamble += " ~__AtAutoreleasePool() {objc_autoreleasePoolPop(atautoreleasepoolobj);}\n";
6047 Preamble += " void * atautoreleasepoolobj;\n";
6048 Preamble += "};\n";
6052 Preamble += "\n#define __OFFSETOFIVAR__(TYPE, MEMBER) ((long long) &((TYPE *)0)->MEMBER)\n";