Home | History | Annotate | Download | only in Rewrite

Lines Matching refs:Preamble

72     std::string Preamble;
2451 Preamble += "static __NSConstantStringImpl " + S;
2452 Preamble += " __attribute__ ((section (\"__DATA, __cfstring\"))) = {__CFConstantStringClassReference,";
2453 Preamble += "0x000007c8,"; // utf8_str
2459 Preamble += prettyBuf.str();
2460 Preamble += ",";
2461 Preamble += utostr(Exp->getString()->getByteLength()) + "};\n";
5558 RewriteObjCProtocolMetaData(*I, Preamble);
5559 Write_ProtocolExprReferencedMetadata(Context, (*I), Preamble);
5562 InsertText(SM->getLocForStartOfFile(MainFileID), Preamble, false);
5605 Preamble += "#ifndef __OBJC2__\n";
5606 Preamble += "#define __OBJC2__\n";
5607 Preamble += "#endif\n";
5612 Preamble = "#pragma once\n";
5613 Preamble += "struct objc_selector; struct objc_class;\n";
5614 Preamble += "struct __rw_objc_super { \n\tstruct objc_object *object; ";
5615 Preamble += "\n\tstruct objc_object *superClass; ";
5617 Preamble += "\n\t__rw_objc_super(struct objc_object *o, struct objc_object *s) ";
5618 Preamble += ": object(o), superClass(s) {} ";
5619 Preamble += "\n};\n";
5624 Preamble += "\n#pragma section(\".objc_classlist$B\", long, read, write)\n";
5625 Preamble += "#pragma section(\".objc_catlist$B\", long, read, write)\n";
5626 Preamble += "#pragma section(\".objc_imageinfo$B\", long, read, write)\n";
5627 Preamble += "#pragma section(\".objc_nlclslist$B\", long, read, write)\n";
5628 Preamble += "#pragma section(\".objc_nlcatlist$B\", long, read, write)\n";
5629 Preamble += "#pragma section(\".objc_protorefs$B\", long, read, write)\n";
5631 Preamble += "#pragma section(\".cat_cls_meth$B\", long, read, write)\n";
5632 Preamble += "#pragma section(\".inst_meth$B\", long, read, write)\n";
5633 Preamble += "#pragma section(\".cls_meth$B\", long, read, write)\n";
5634 Preamble += "#pragma section(\".objc_ivar$B\", long, read, write)\n";
5638 Preamble += "#pragma section(\".objc_selrefs$B\", long, read, write)\n";
5639 Preamble += "#pragma section(\".objc_classrefs$B\", long, read, write)\n";
5640 Preamble += "#pragma section(\".objc_superrefs$B\", long, read, write)\n";
5643 Preamble += "#ifndef _REWRITER_typedef_Protocol\n";
5644 Preamble += "typedef struct objc_object Protocol;\n";
5645 Preamble += "#define _REWRITER_typedef_Protocol\n";
5646 Preamble += "#endif\n";
5648 Preamble += "#define __OBJC_RW_DLLIMPORT extern \"C\" __declspec(dllimport)\n";
5649 Preamble += "#define __OBJC_RW_STATICIMPORT extern \"C\"\n";
5652 Preamble += "#define __OBJC_RW_DLLIMPORT extern\n";
5654 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend(void);\n";
5655 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper(void);\n";
5656 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_stret(void);\n";
5657 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSendSuper_stret(void);\n";
5658 Preamble += "__OBJC_RW_DLLIMPORT void objc_msgSend_fpret(void);\n";
5660 Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getClass";
5661 Preamble += "(const char *);\n";
5662 Preamble += "__OBJC_RW_DLLIMPORT struct objc_class *class_getSuperclass";
5663 Preamble += "(struct objc_class *);\n";
5664 Preamble += "__OBJC_RW_DLLIMPORT struct objc_object *objc_getMetaClass";
5665 Preamble += "(const char *);\n";
5666 Preamble += "__OBJC_RW_DLLIMPORT void objc_exception_throw( struct objc_object *);\n";
5668 Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_enter( struct objc_object *);\n";
5669 Preamble += "__OBJC_RW_DLLIMPORT void objc_sync_exit( struct objc_object *);\n";
5670 Preamble += "__OBJC_RW_DLLIMPORT Protocol *objc_getProtocol(const char *);\n";
5671 Preamble += "#ifndef __FASTENUMERATIONSTATE\n";
5672 Preamble += "struct __objcFastEnumerationState {\n\t";
5673 Preamble += "unsigned long state;\n\t";
5674 Preamble += "void **itemsPtr;\n\t";
5675 Preamble += "unsigned long *mutationsPtr;\n\t";
5676 Preamble += "unsigned long extra[5];\n};\n";
5677 Preamble += "__OBJC_RW_DLLIMPORT void objc_enumerationMutation(struct objc_object *);\n";
5678 Preamble += "#define __FASTENUMERATIONSTATE\n";
5679 Preamble += "#endif\n";
5680 Preamble += "#ifndef __NSCONSTANTSTRINGIMPL\n";
5681 Preamble += "struct __NSConstantStringImpl {\n";
5682 Preamble += " int *isa;\n";
5683 Preamble += " int flags;\n";
5684 Preamble += " char *str;\n";
5685 Preamble += " long length;\n";
5686 Preamble += "};\n";
5687 Preamble += "#ifdef CF_EXPORT_CONSTANT_STRING\n";
5688 Preamble += "extern \"C\" __declspec(dllexport) int __CFConstantStringClassReference[];\n";
5689 Preamble += "#else\n";
5690 Preamble += "__OBJC_RW_DLLIMPORT int __CFConstantStringClassReference[];\n";
5691 Preamble += "#endif\n";
5692 Preamble += "#define __NSCONSTANTSTRINGIMPL\n";
5693 Preamble += "#endif\n";
5694 // Blocks preamble.
5695 Preamble += "#ifndef BLOCK_IMPL\n";
5696 Preamble += "#define BLOCK_IMPL\n";
5697 Preamble += "struct __block_impl {\n";
5698 Preamble += " void *isa;\n";
5699 Preamble += " int Flags;\n";
5700 Preamble += " int Reserved;\n";
5701 Preamble += " void *FuncPtr;\n";
5702 Preamble += "};\n";
5703 Preamble += "// Runtime copy/destroy helper functions (from Block_private.h)\n";
5704 Preamble += "#ifdef __OBJC_EXPORT_BLOCKS\n";
5705 Preamble += "extern \"C\" __declspec(dllexport) "
5707 Preamble += "extern \"C\" __declspec(dllexport) void _Block_object_dispose(const void *, const int);\n";
5708 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteGlobalBlock[32];\n";
5709 Preamble += "extern \"C\" __declspec(dllexport) void *_NSConcreteStackBlock[32];\n";
5710 Preamble += "#else\n";
5711 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_assign(void *, const void *, const int);\n";
5712 Preamble += "__OBJC_RW_DLLIMPORT void _Block_object_dispose(const void *, const int);\n";
5713 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteGlobalBlock[32];\n";
5714 Preamble += "__OBJC_RW_DLLIMPORT void *_NSConcreteStackBlock[32];\n";
5715 Preamble += "#endif\n";
5716 Preamble += "#endif\n";
5718 Preamble += "#undef __OBJC_RW_DLLIMPORT\n";
5719 Preamble += "#undef __OBJC_RW_STATICIMPORT\n";
5720 Preamble += "#ifndef KEEP_ATTRIBUTES\n"; // We use this for clang tests.
5721 Preamble += "#define __attribute__(X)\n";
5722 Preamble += "#endif\n";
5723 Preamble += "#ifndef __weak\n";
5724 Preamble += "#define __weak\n";
5725 Preamble += "#endif\n";
5726 Preamble += "#ifndef __block\n";
5727 Preamble += "#define __block\n";
5728 Preamble += "#endif\n";
5731 Preamble += "#define __block\n";
5732 Preamble += "#define __weak\n";
5736 Preamble += "\n#include <stdarg.h>\n";
5737 Preamble += "struct __NSContainer_literal {\n";
5738 Preamble += " void * *arr;\n";
5739 Preamble += " __NSContainer_literal (unsigned int count, ...) {\n";
5740 Preamble += "\tva_list marker;\n";
5741 Preamble += "\tva_start(marker, count);\n";
5742 Preamble += "\tarr = new void *[count];\n";
5743 Preamble += "\tfor (unsigned i = 0; i < count; i++)\n";
5744 Preamble += "\t arr[i] = va_arg(marker, void *);\n";
5745 Preamble
5746 Preamble += " };\n";
5747 Preamble += " __NSContainer_literal() {\n";
5748 Preamble += "\tdelete[] arr;\n";
5749 Preamble += " }\n";
5750 Preamble += "};\n";
5754 Preamble += "\n#define __OFFSETOFIVAR__(TYPE, MEMBER) ((long long) &((TYPE *)0)->MEMBER)\n";