• Home
  • Raw
  • Download

Lines Matching refs:Result

375     void ObjCIvarBitfieldGroupDecl(ObjCIvarDecl *IV, std::string &Result);
377 void ObjCIvarBitfieldGroupType(ObjCIvarDecl *IV, std::string &Result);
379 void ObjCIvarBitfieldGroupOffset(ObjCIvarDecl *IV, std::string &Result);
397 std::string &Result);
399 void RewriteObjCFieldDecl(FieldDecl *fieldDecl, std::string &Result);
403 std::string &Result);
405 bool RewriteObjCFieldDeclType(QualType &Type, std::string &Result);
408 std::string &Result);
448 std::string &Result);
450 std::string &Result);
453 StringRef prefix, StringRef ClassName, std::string &Result);
455 std::string &Result);
456 void RewriteClassSetupInitHook(std::string &Result);
458 void RewriteMetaDataIntoBuffer(std::string &Result);
459 void WriteImageInfo(std::string &Result);
461 std::string &Result);
462 void RewriteCategorySetupInitHook(std::string &Result);
466 std::string &Result);
838 ObjCIvarDecl *IvarDecl, std::string &Result) { in WriteInternalIvarName() argument
839 Result += "OBJC_IVAR_$_"; in WriteInternalIvarName()
840 Result += IDecl->getName(); in WriteInternalIvarName()
841 Result += "$"; in WriteInternalIvarName()
842 Result += IvarDecl->getName(); in WriteInternalIvarName()
1992 std::string Result; in RewriteObjCTryStmt() local
1993 ConvertSourceLocationToLineDirective(Catch->getLocStart(), Result); in RewriteObjCTryStmt()
2001 Result += "catch (_objc_exc_"; Result += IDecl->getNameAsString(); in RewriteObjCTryStmt()
2002 Result += " *_"; Result += catchDecl->getNameAsString(); in RewriteObjCTryStmt()
2003 Result += ")"; in RewriteObjCTryStmt()
2004 ReplaceText(startLoc, rParenBuf-startBuf+1, Result); in RewriteObjCTryStmt()
2006 Result.clear(); in RewriteObjCTryStmt()
2007 Result = "{ "; in RewriteObjCTryStmt()
2008 Result += IDecl->getNameAsString(); in RewriteObjCTryStmt()
2009 Result += " *"; Result += catchDecl->getNameAsString(); in RewriteObjCTryStmt()
2010 Result += " = ("; Result += IDecl->getNameAsString(); Result += "*)"; in RewriteObjCTryStmt()
2011 Result += "_"; Result += catchDecl->getNameAsString(); in RewriteObjCTryStmt()
2013 Result += "; "; in RewriteObjCTryStmt()
2015 ReplaceText(lBraceLoc, 1, Result); in RewriteObjCTryStmt()
3699 std::string &Result) { in RewriteObjCFieldDeclType() argument
3701 Result += "\t"; in RewriteObjCFieldDeclType()
3707 return RewriteObjCFieldDeclType(ElemTy, Result); in RewriteObjCFieldDeclType()
3713 Result += "\n\tstruct "; in RewriteObjCFieldDeclType()
3715 Result += "\n\tunion "; in RewriteObjCFieldDeclType()
3719 Result += RD->getName(); in RewriteObjCFieldDeclType()
3722 Result += " "; in RewriteObjCFieldDeclType()
3725 Result += " {\n"; in RewriteObjCFieldDeclType()
3727 RewriteObjCFieldDecl(FD, Result); in RewriteObjCFieldDeclType()
3728 Result += "\t} "; in RewriteObjCFieldDeclType()
3735 Result += "\n\tenum "; in RewriteObjCFieldDeclType()
3736 Result += ED->getName(); in RewriteObjCFieldDeclType()
3739 Result += " "; in RewriteObjCFieldDeclType()
3743 Result += " {\n"; in RewriteObjCFieldDeclType()
3745 Result += "\t"; Result += EC->getName(); Result += " = "; in RewriteObjCFieldDeclType()
3747 Result += Val.toString(10); in RewriteObjCFieldDeclType()
3748 Result += ",\n"; in RewriteObjCFieldDeclType()
3750 Result += "\t} "; in RewriteObjCFieldDeclType()
3755 Result += "\t"; in RewriteObjCFieldDeclType()
3764 std::string &Result) { in RewriteObjCFieldDecl() argument
3768 bool EleboratedType = RewriteObjCFieldDeclType(Type, Result); in RewriteObjCFieldDecl()
3771 Result += Name; in RewriteObjCFieldDecl()
3773 Result += " : "; Result += utostr(fieldDecl->getBitWidthValue(*Context)); in RewriteObjCFieldDecl()
3779 Result += "["; in RewriteObjCFieldDecl()
3781 Result += utostr(Dim.getZExtValue()); in RewriteObjCFieldDecl()
3782 Result += "]"; in RewriteObjCFieldDecl()
3788 Result += ";\n"; in RewriteObjCFieldDecl()
3794 std::string &Result) { in RewriteLocallyDefinedNamedAggregates() argument
3817 RewriteObjCFieldDeclType(Type, Result); in RewriteLocallyDefinedNamedAggregates()
3818 Result += ";"; in RewriteLocallyDefinedNamedAggregates()
3908 std::string &Result) { in ObjCIvarBitfieldGroupDecl() argument
3910 Result += CDecl->getName(); in ObjCIvarBitfieldGroupDecl()
3911 Result += "__GRBF_"; in ObjCIvarBitfieldGroupDecl()
3913 Result += utostr(GroupNo); in ObjCIvarBitfieldGroupDecl()
3921 std::string &Result) { in ObjCIvarBitfieldGroupType() argument
3923 Result += CDecl->getName(); in ObjCIvarBitfieldGroupType()
3924 Result += "__T_"; in ObjCIvarBitfieldGroupType()
3926 Result += utostr(GroupNo); in ObjCIvarBitfieldGroupType()
3934 std::string &Result) { in ObjCIvarBitfieldGroupOffset() argument
3935 Result += "OBJC_IVAR_$_"; in ObjCIvarBitfieldGroupOffset()
3936 ObjCIvarBitfieldGroupDecl(IV, Result); in ObjCIvarBitfieldGroupOffset()
3949 std::string &Result) { in RewriteObjCInternalStruct() argument
3970 ReplaceText(LocStart, endBuf-startBuf, Result); in RewriteObjCInternalStruct()
3978 RewriteLocallyDefinedNamedAggregates(IVars[i], Result); in RewriteObjCInternalStruct()
3986 RewriteObjCFieldDeclType(QT, Result); in RewriteObjCInternalStruct()
3987 Result += ";"; in RewriteObjCInternalStruct()
3992 Result += "\nstruct "; in RewriteObjCInternalStruct()
3993 Result += CDecl->getNameAsString(); in RewriteObjCInternalStruct()
3994 Result += "_IMPL {\n"; in RewriteObjCInternalStruct()
3997 Result += "\tstruct "; Result += RCDecl->getNameAsString(); in RewriteObjCInternalStruct()
3998 Result += "_IMPL "; Result += RCDecl->getNameAsString(); in RewriteObjCInternalStruct()
3999 Result += "_IVARS;\n"; in RewriteObjCInternalStruct()
4005 Result += "\tstruct "; in RewriteObjCInternalStruct()
4006 ObjCIvarBitfieldGroupType(IV, Result); Result += " "; in RewriteObjCInternalStruct()
4007 ObjCIvarBitfieldGroupDecl(IV, Result); Result += ";\n"; in RewriteObjCInternalStruct()
4012 RewriteObjCFieldDecl(IVars[i], Result); in RewriteObjCInternalStruct()
4015 Result += "};\n"; in RewriteObjCInternalStruct()
4017 ReplaceText(LocStart, endBuf-startBuf, Result); in RewriteObjCInternalStruct()
4026 std::string &Result) { in RewriteIvarOffsetSymbols() argument
4042 Result += "\n"; in RewriteIvarOffsetSymbols()
4044 Result += "__declspec(allocate(\".objc_ivar$B\")) "; in RewriteIvarOffsetSymbols()
4045 Result += "extern \"C\" "; in RewriteIvarOffsetSymbols()
4049 Result += "__declspec(dllimport) "; in RewriteIvarOffsetSymbols()
4051 Result += "unsigned long "; in RewriteIvarOffsetSymbols()
4053 ObjCIvarBitfieldGroupOffset(IvarDecl, Result); in RewriteIvarOffsetSymbols()
4057 WriteInternalIvarName(CDecl, IvarDecl, Result); in RewriteIvarOffsetSymbols()
4058 Result += ";"; in RewriteIvarOffsetSymbols()
5902 std::string &Result) { in Write_ProtocolExprReferencedMetadata() argument
5905 Result += "static "; in Write_ProtocolExprReferencedMetadata()
5906 Result += "struct _protocol_t *"; in Write_ProtocolExprReferencedMetadata()
5907 Result += "_OBJC_PROTOCOL_REFERENCE_$_"; in Write_ProtocolExprReferencedMetadata()
5908 Result += PDecl->getNameAsString(); in Write_ProtocolExprReferencedMetadata()
5909 Result += " = &"; in Write_ProtocolExprReferencedMetadata()
5910 Result += "_OBJC_PROTOCOL_"; Result += PDecl->getNameAsString(); in Write_ProtocolExprReferencedMetadata()
5911 Result += ";\n"; in Write_ProtocolExprReferencedMetadata()
6151 std::string &Result) { in RewriteIvarOffsetComputation() argument
6152 Result += "__OFFSETOFIVAR__(struct "; in RewriteIvarOffsetComputation()
6153 Result += ivar->getContainingInterface()->getNameAsString(); in RewriteIvarOffsetComputation()
6155 Result += "_IMPL"; in RewriteIvarOffsetComputation()
6156 Result += ", "; in RewriteIvarOffsetComputation()
6158 ObjCIvarBitfieldGroupDecl(ivar, Result); in RewriteIvarOffsetComputation()
6160 Result += ivar->getNameAsString(); in RewriteIvarOffsetComputation()
6161 Result += ")"; in RewriteIvarOffsetComputation()
6266 static void WriteModernMetadataDeclarations(ASTContext *Context, std::string &Result) { in WriteModernMetadataDeclarations() argument
6271 Result += "\nstruct _prop_t {\n"; in WriteModernMetadataDeclarations()
6272 Result += "\tconst char *name;\n"; in WriteModernMetadataDeclarations()
6273 Result += "\tconst char *attributes;\n"; in WriteModernMetadataDeclarations()
6274 Result += "};\n"; in WriteModernMetadataDeclarations()
6276 Result += "\nstruct _protocol_t;\n"; in WriteModernMetadataDeclarations()
6278 Result += "\nstruct _objc_method {\n"; in WriteModernMetadataDeclarations()
6279 Result += "\tstruct objc_selector * _cmd;\n"; in WriteModernMetadataDeclarations()
6280 Result += "\tconst char *method_type;\n"; in WriteModernMetadataDeclarations()
6281 Result += "\tvoid *_imp;\n"; in WriteModernMetadataDeclarations()
6282 Result += "};\n"; in WriteModernMetadataDeclarations()
6284 Result += "\nstruct _protocol_t {\n"; in WriteModernMetadataDeclarations()
6285 Result += "\tvoid * isa; // NULL\n"; in WriteModernMetadataDeclarations()
6286 Result += "\tconst char *protocol_name;\n"; in WriteModernMetadataDeclarations()
6287 Result += "\tconst struct _protocol_list_t * protocol_list; // super protocols\n"; in WriteModernMetadataDeclarations()
6288 Result += "\tconst struct method_list_t *instance_methods;\n"; in WriteModernMetadataDeclarations()
6289 Result += "\tconst struct method_list_t *class_methods;\n"; in WriteModernMetadataDeclarations()
6290 Result += "\tconst struct method_list_t *optionalInstanceMethods;\n"; in WriteModernMetadataDeclarations()
6291 Result += "\tconst struct method_list_t *optionalClassMethods;\n"; in WriteModernMetadataDeclarations()
6292 Result += "\tconst struct _prop_list_t * properties;\n"; in WriteModernMetadataDeclarations()
6293 Result += "\tconst unsigned int size; // sizeof(struct _protocol_t)\n"; in WriteModernMetadataDeclarations()
6294 Result += "\tconst unsigned int flags; // = 0\n"; in WriteModernMetadataDeclarations()
6295 Result += "\tconst char ** extendedMethodTypes;\n"; in WriteModernMetadataDeclarations()
6296 Result += "};\n"; in WriteModernMetadataDeclarations()
6298 Result += "\nstruct _ivar_t {\n"; in WriteModernMetadataDeclarations()
6299 Result += "\tunsigned long int *offset; // pointer to ivar offset location\n"; in WriteModernMetadataDeclarations()
6300 Result += "\tconst char *name;\n"; in WriteModernMetadataDeclarations()
6301 Result += "\tconst char *type;\n"; in WriteModernMetadataDeclarations()
6302 Result += "\tunsigned int alignment;\n"; in WriteModernMetadataDeclarations()
6303 Result += "\tunsigned int size;\n"; in WriteModernMetadataDeclarations()
6304 Result += "};\n"; in WriteModernMetadataDeclarations()
6306 Result += "\nstruct _class_ro_t {\n"; in WriteModernMetadataDeclarations()
6307 Result += "\tunsigned int flags;\n"; in WriteModernMetadataDeclarations()
6308 Result += "\tunsigned int instanceStart;\n"; in WriteModernMetadataDeclarations()
6309 Result += "\tunsigned int instanceSize;\n"; in WriteModernMetadataDeclarations()
6312 Result += "\tunsigned int reserved;\n"; in WriteModernMetadataDeclarations()
6313 Result += "\tconst unsigned char *ivarLayout;\n"; in WriteModernMetadataDeclarations()
6314 Result += "\tconst char *name;\n"; in WriteModernMetadataDeclarations()
6315 Result += "\tconst struct _method_list_t *baseMethods;\n"; in WriteModernMetadataDeclarations()
6316 Result += "\tconst struct _objc_protocol_list *baseProtocols;\n"; in WriteModernMetadataDeclarations()
6317 Result += "\tconst struct _ivar_list_t *ivars;\n"; in WriteModernMetadataDeclarations()
6318 Result += "\tconst unsigned char *weakIvarLayout;\n"; in WriteModernMetadataDeclarations()
6319 Result += "\tconst struct _prop_list_t *properties;\n"; in WriteModernMetadataDeclarations()
6320 Result += "};\n"; in WriteModernMetadataDeclarations()
6322 Result += "\nstruct _class_t {\n"; in WriteModernMetadataDeclarations()
6323 Result += "\tstruct _class_t *isa;\n"; in WriteModernMetadataDeclarations()
6324 Result += "\tstruct _class_t *superclass;\n"; in WriteModernMetadataDeclarations()
6325 Result += "\tvoid *cache;\n"; in WriteModernMetadataDeclarations()
6326 Result += "\tvoid *vtable;\n"; in WriteModernMetadataDeclarations()
6327 Result += "\tstruct _class_ro_t *ro;\n"; in WriteModernMetadataDeclarations()
6328 Result += "};\n"; in WriteModernMetadataDeclarations()
6330 Result += "\nstruct _category_t {\n"; in WriteModernMetadataDeclarations()
6331 Result += "\tconst char *name;\n"; in WriteModernMetadataDeclarations()
6332 Result += "\tstruct _class_t *cls;\n"; in WriteModernMetadataDeclarations()
6333 Result += "\tconst struct _method_list_t *instance_methods;\n"; in WriteModernMetadataDeclarations()
6334 Result += "\tconst struct _method_list_t *class_methods;\n"; in WriteModernMetadataDeclarations()
6335 Result += "\tconst struct _protocol_list_t *protocols;\n"; in WriteModernMetadataDeclarations()
6336 Result += "\tconst struct _prop_list_t *properties;\n"; in WriteModernMetadataDeclarations()
6337 Result += "};\n"; in WriteModernMetadataDeclarations()
6339 Result += "extern \"C\" __declspec(dllimport) struct objc_cache _objc_empty_cache;\n"; in WriteModernMetadataDeclarations()
6340 Result += "#pragma warning(disable:4273)\n"; in WriteModernMetadataDeclarations()
6344 static void Write_protocol_list_t_TypeDecl(std::string &Result, in Write_protocol_list_t_TypeDecl() argument
6346 Result += "struct /*_protocol_list_t*/"; Result += " {\n"; in Write_protocol_list_t_TypeDecl()
6347 Result += "\tlong protocol_count; // Note, this is 32/64 bit\n"; in Write_protocol_list_t_TypeDecl()
6348 Result += "\tstruct _protocol_t *super_protocols["; in Write_protocol_list_t_TypeDecl()
6349 Result += utostr(super_protocol_count); Result += "];\n"; in Write_protocol_list_t_TypeDecl()
6350 Result += "}"; in Write_protocol_list_t_TypeDecl()
6353 static void Write_method_list_t_TypeDecl(std::string &Result, in Write_method_list_t_TypeDecl() argument
6355 Result += "struct /*_method_list_t*/"; Result += " {\n"; in Write_method_list_t_TypeDecl()
6356 Result += "\tunsigned int entsize; // sizeof(struct _objc_method)\n"; in Write_method_list_t_TypeDecl()
6357 Result += "\tunsigned int method_count;\n"; in Write_method_list_t_TypeDecl()
6358 Result += "\tstruct _objc_method method_list["; in Write_method_list_t_TypeDecl()
6359 Result += utostr(method_count); Result += "];\n"; in Write_method_list_t_TypeDecl()
6360 Result += "}"; in Write_method_list_t_TypeDecl()
6363 static void Write__prop_list_t_TypeDecl(std::string &Result, in Write__prop_list_t_TypeDecl() argument
6365 Result += "struct /*_prop_list_t*/"; Result += " {\n"; in Write__prop_list_t_TypeDecl()
6366 Result += "\tunsigned int entsize; // sizeof(struct _prop_t)\n"; in Write__prop_list_t_TypeDecl()
6367 Result += "\tunsigned int count_of_properties;\n"; in Write__prop_list_t_TypeDecl()
6368 Result += "\tstruct _prop_t prop_list["; in Write__prop_list_t_TypeDecl()
6369 Result += utostr(property_count); Result += "];\n"; in Write__prop_list_t_TypeDecl()
6370 Result += "}"; in Write__prop_list_t_TypeDecl()
6373 static void Write__ivar_list_t_TypeDecl(std::string &Result, in Write__ivar_list_t_TypeDecl() argument
6375 Result += "struct /*_ivar_list_t*/"; Result += " {\n"; in Write__ivar_list_t_TypeDecl()
6376 Result += "\tunsigned int entsize; // sizeof(struct _prop_t)\n"; in Write__ivar_list_t_TypeDecl()
6377 Result += "\tunsigned int count;\n"; in Write__ivar_list_t_TypeDecl()
6378 Result += "\tstruct _ivar_t ivar_list["; in Write__ivar_list_t_TypeDecl()
6379 Result += utostr(ivar_count); Result += "];\n"; in Write__ivar_list_t_TypeDecl()
6380 Result += "}"; in Write__ivar_list_t_TypeDecl()
6383 static void Write_protocol_list_initializer(ASTContext *Context, std::string &Result, in Write_protocol_list_initializer() argument
6388 Result += "\nstatic "; in Write_protocol_list_initializer()
6389 Write_protocol_list_t_TypeDecl(Result, SuperProtocols.size()); in Write_protocol_list_initializer()
6390 Result += " "; Result += VarName; in Write_protocol_list_initializer()
6391 Result += ProtocolName; in Write_protocol_list_initializer()
6392 Result += " __attribute__ ((used, section (\"__DATA,__objc_const\"))) = {\n"; in Write_protocol_list_initializer()
6393 Result += "\t"; Result += utostr(SuperProtocols.size()); Result += ",\n"; in Write_protocol_list_initializer()
6396 Result += "\t&"; Result += "_OBJC_PROTOCOL_"; in Write_protocol_list_initializer()
6397 Result += SuperPD->getNameAsString(); in Write_protocol_list_initializer()
6399 Result += "\n};\n"; in Write_protocol_list_initializer()
6401 Result += ",\n"; in Write_protocol_list_initializer()
6407 ASTContext *Context, std::string &Result, in Write_method_list_t_initializer() argument
6413 Result += "\nstatic "; in Write_method_list_t_initializer()
6414 Write_method_list_t_TypeDecl(Result, Methods.size()); in Write_method_list_t_initializer()
6415 Result += " "; Result += VarName; in Write_method_list_t_initializer()
6416 Result += TopLevelDeclName; in Write_method_list_t_initializer()
6417 Result += " __attribute__ ((used, section (\"__DATA,__objc_const\"))) = {\n"; in Write_method_list_t_initializer()
6418 Result += "\t"; Result += "sizeof(_objc_method)"; Result += ",\n"; in Write_method_list_t_initializer()
6419 Result += "\t"; Result += utostr(Methods.size()); Result += ",\n"; in Write_method_list_t_initializer()
6423 Result += "\t{{(struct objc_selector *)\""; in Write_method_list_t_initializer()
6425 Result += "\t{(struct objc_selector *)\""; in Write_method_list_t_initializer()
6426 Result += (MD)->getSelector().getAsString(); Result += "\""; in Write_method_list_t_initializer()
6427 Result += ", "; in Write_method_list_t_initializer()
6430 Result += "\""; Result += MethodTypeString; Result += "\""; in Write_method_list_t_initializer()
6431 Result += ", "; in Write_method_list_t_initializer()
6433 Result += "0"; in Write_method_list_t_initializer()
6435 Result += "(void *)"; in Write_method_list_t_initializer()
6436 Result += RewriteObj.MethodInternalNames[MD]; in Write_method_list_t_initializer()
6439 Result += "}}\n"; in Write_method_list_t_initializer()
6441 Result += "},\n"; in Write_method_list_t_initializer()
6443 Result += "};\n"; in Write_method_list_t_initializer()
6448 ASTContext *Context, std::string &Result, in Write_prop_list_t_initializer() argument
6454 Result += "\nstatic "; in Write_prop_list_t_initializer()
6455 Write__prop_list_t_TypeDecl(Result, Properties.size()); in Write_prop_list_t_initializer()
6456 Result += " "; Result += VarName; in Write_prop_list_t_initializer()
6457 Result += ProtocolName; in Write_prop_list_t_initializer()
6458 Result += " __attribute__ ((used, section (\"__DATA,__objc_const\"))) = {\n"; in Write_prop_list_t_initializer()
6459 Result += "\t"; Result += "sizeof(_prop_t)"; Result += ",\n"; in Write_prop_list_t_initializer()
6460 Result += "\t"; Result += utostr(Properties.size()); Result += ",\n"; in Write_prop_list_t_initializer()
6464 Result += "\t{{\""; in Write_prop_list_t_initializer()
6466 Result += "\t{\""; in Write_prop_list_t_initializer()
6467 Result += PropDecl->getName(); Result += "\","; in Write_prop_list_t_initializer()
6471 Result += "\""; Result += QuotePropertyTypeString; Result += "\""; in Write_prop_list_t_initializer()
6473 Result += "}}\n"; in Write_prop_list_t_initializer()
6475 Result += "},\n"; in Write_prop_list_t_initializer()
6477 Result += "};\n"; in Write_prop_list_t_initializer()
6495 static void Write__class_ro_t_initializer(ASTContext *Context, std::string &Result, in Write__class_ro_t_initializer() argument
6505 Result += "\nstatic struct _class_ro_t "; in Write__class_ro_t_initializer()
6506 Result += VarName; Result += ClassName; in Write__class_ro_t_initializer()
6507 Result += " __attribute__ ((used, section (\"__DATA,__objc_const\"))) = {\n"; in Write__class_ro_t_initializer()
6508 Result += "\t"; in Write__class_ro_t_initializer()
6509 Result += llvm::utostr(flags); Result += ", "; in Write__class_ro_t_initializer()
6510 Result += InstanceStart; Result += ", "; in Write__class_ro_t_initializer()
6511 Result += InstanceSize; Result += ", \n"; in Write__class_ro_t_initializer()
6512 Result += "\t"; in Write__class_ro_t_initializer()
6516 Result += "(unsigned int)0, \n\t"; in Write__class_ro_t_initializer()
6518 Result += "0, \n\t"; in Write__class_ro_t_initializer()
6519 Result += "\""; Result += ClassName; Result += "\",\n\t"; in Write__class_ro_t_initializer()
6522 Result += "(const struct _method_list_t *)&"; in Write__class_ro_t_initializer()
6524 Result += "_OBJC_$_CLASS_METHODS_"; in Write__class_ro_t_initializer()
6526 Result += "_OBJC_$_INSTANCE_METHODS_"; in Write__class_ro_t_initializer()
6527 Result += ClassName; in Write__class_ro_t_initializer()
6528 Result += ",\n\t"; in Write__class_ro_t_initializer()
6531 Result += "0, \n\t"; in Write__class_ro_t_initializer()
6534 Result += "(const struct _objc_protocol_list *)&"; in Write__class_ro_t_initializer()
6535 Result += "_OBJC_CLASS_PROTOCOLS_$_"; Result += ClassName; in Write__class_ro_t_initializer()
6536 Result += ",\n\t"; in Write__class_ro_t_initializer()
6539 Result += "0, \n\t"; in Write__class_ro_t_initializer()
6542 Result += "(const struct _ivar_list_t *)&"; in Write__class_ro_t_initializer()
6543 Result += "_OBJC_$_INSTANCE_VARIABLES_"; Result += ClassName; in Write__class_ro_t_initializer()
6544 Result += ",\n\t"; in Write__class_ro_t_initializer()
6547 Result += "0, \n\t"; in Write__class_ro_t_initializer()
6550 Result += "0, \n\t"; in Write__class_ro_t_initializer()
6552 Result += "(const struct _prop_list_t *)&"; in Write__class_ro_t_initializer()
6553 Result += "_OBJC_$_PROP_LIST_"; Result += ClassName; in Write__class_ro_t_initializer()
6554 Result += ",\n"; in Write__class_ro_t_initializer()
6557 Result += "0, \n"; in Write__class_ro_t_initializer()
6559 Result += "};\n"; in Write__class_ro_t_initializer()
6562 static void Write_class_t(ASTContext *Context, std::string &Result, in Write_class_t() argument
6578 Result += "\n"; in Write_class_t()
6579 Result += "extern \"C\" "; in Write_class_t()
6581 Result += "__declspec(dllexport) "; in Write_class_t()
6583 Result += "__declspec(dllimport) "; in Write_class_t()
6585 Result += "struct _class_t OBJC_CLASS_$_"; in Write_class_t()
6586 Result += CDecl->getNameAsString(); in Write_class_t()
6587 Result += ";\n"; in Write_class_t()
6592 Result += "\n"; in Write_class_t()
6593 Result += "extern \"C\" "; in Write_class_t()
6595 Result += "__declspec(dllexport) "; in Write_class_t()
6597 Result += "__declspec(dllimport) "; in Write_class_t()
6599 Result += "struct _class_t "; in Write_class_t()
6600 Result += VarName; in Write_class_t()
6601 Result += SuperClass->getNameAsString(); in Write_class_t()
6602 Result += ";\n"; in Write_class_t()
6605 Result += "extern \"C\" "; in Write_class_t()
6607 Result += "__declspec(dllexport) "; in Write_class_t()
6609 Result += "__declspec(dllimport) "; in Write_class_t()
6611 Result += "struct _class_t "; in Write_class_t()
6612 Result += VarName; in Write_class_t()
6613 Result += RootClass->getNameAsString(); in Write_class_t()
6614 Result += ";\n"; in Write_class_t()
6618 Result += "\nextern \"C\" __declspec(dllexport) struct _class_t "; in Write_class_t()
6619 Result += VarName; Result += CDecl->getNameAsString(); in Write_class_t()
6620 Result += " __attribute__ ((used, section (\"__DATA,__objc_data\"))) = {\n"; in Write_class_t()
6621 Result += "\t"; in Write_class_t()
6624 Result += "0, // &"; Result += VarName; in Write_class_t()
6625 Result += RootClass->getNameAsString(); in Write_class_t()
6626 Result += ",\n\t"; in Write_class_t()
6627 Result += "0, // &"; Result += VarName; in Write_class_t()
6628 Result += CDecl->getSuperClass()->getNameAsString(); in Write_class_t()
6629 Result += ",\n\t"; in Write_class_t()
6632 Result += "0, // &"; Result += VarName; in Write_class_t()
6633 Result += CDecl->getNameAsString(); in Write_class_t()
6634 Result += ",\n\t"; in Write_class_t()
6635 Result += "0, // &OBJC_CLASS_$_"; Result += CDecl->getNameAsString(); in Write_class_t()
6636 Result += ",\n\t"; in Write_class_t()
6640 Result += "0, // &OBJC_METACLASS_$_"; in Write_class_t()
6641 Result += CDecl->getNameAsString(); in Write_class_t()
6642 Result += ",\n\t"; in Write_class_t()
6644 Result += "0, // &"; Result += VarName; in Write_class_t()
6645 Result += CDecl->getSuperClass()->getNameAsString(); in Write_class_t()
6646 Result += ",\n\t"; in Write_class_t()
6649 Result += "0,\n\t"; in Write_class_t()
6651 Result += "0, // (void *)&_objc_empty_cache,\n\t"; in Write_class_t()
6652 Result += "0, // unused, was (void *)&_objc_empty_vtable,\n\t"; in Write_class_t()
6654 Result += "&_OBJC_METACLASS_RO_$_"; in Write_class_t()
6656 Result += "&_OBJC_CLASS_RO_$_"; in Write_class_t()
6657 Result += CDecl->getNameAsString(); in Write_class_t()
6658 Result += ",\n};\n"; in Write_class_t()
6668 Result += "static void OBJC_CLASS_SETUP_$_"; in Write_class_t()
6669 Result += CDecl->getNameAsString(); in Write_class_t()
6670 Result += "(void ) {\n"; in Write_class_t()
6671 Result += "\tOBJC_METACLASS_$_"; Result += CDecl->getNameAsString(); in Write_class_t()
6672 Result += ".isa = "; Result += "&OBJC_METACLASS_$_"; in Write_class_t()
6673 Result += RootClass->getNameAsString(); Result += ";\n"; in Write_class_t()
6675 Result += "\tOBJC_METACLASS_$_"; Result += CDecl->getNameAsString(); in Write_class_t()
6676 Result += ".superclass = "; in Write_class_t()
6678 Result += "&OBJC_CLASS_$_"; in Write_class_t()
6680 Result += "&OBJC_METACLASS_$_"; in Write_class_t()
6682 Result += SuperClass->getNameAsString(); Result += ";\n"; in Write_class_t()
6684 Result += "\tOBJC_METACLASS_$_"; Result += CDecl->getNameAsString(); in Write_class_t()
6685 Result += ".cache = "; Result += "&_objc_empty_cache"; Result += ";\n"; in Write_class_t()
6687 Result += "\tOBJC_CLASS_$_"; Result += CDecl->getNameAsString(); in Write_class_t()
6688 Result += ".isa = "; Result += "&OBJC_METACLASS_$_"; in Write_class_t()
6689 Result += CDecl->getNameAsString(); Result += ";\n"; in Write_class_t()
6692 Result += "\tOBJC_CLASS_$_"; Result += CDecl->getNameAsString(); in Write_class_t()
6693 Result += ".superclass = "; Result += "&OBJC_CLASS_$_"; in Write_class_t()
6694 Result += SuperClass->getNameAsString(); Result += ";\n"; in Write_class_t()
6697 Result += "\tOBJC_CLASS_$_"; Result += CDecl->getNameAsString(); in Write_class_t()
6698 Result += ".cache = "; Result += "&_objc_empty_cache"; Result += ";\n"; in Write_class_t()
6699 Result += "}\n"; in Write_class_t()
6703 std::string &Result, in Write_category_t() argument
6714 Result += "\n"; in Write_category_t()
6715 Result += "extern \"C\" "; in Write_category_t()
6717 Result += "__declspec(dllexport) "; in Write_category_t()
6719 Result += "__declspec(dllimport) "; in Write_category_t()
6721 Result += "struct _class_t "; in Write_category_t()
6722 Result += "OBJC_CLASS_$_"; Result += ClassName; in Write_category_t()
6723 Result += ";\n"; in Write_category_t()
6725 Result += "\nstatic struct _category_t "; in Write_category_t()
6726 Result += "_OBJC_$_CATEGORY_"; in Write_category_t()
6727 Result += ClassName; Result += "_$_"; Result += CatName; in Write_category_t()
6728 Result += " __attribute__ ((used, section (\"__DATA,__objc_const\"))) = \n"; in Write_category_t()
6729 Result += "{\n"; in Write_category_t()
6730 Result += "\t\""; Result += ClassName; Result += "\",\n"; in Write_category_t()
6731 Result += "\t0, // &"; Result += "OBJC_CLASS_$_"; Result += ClassName; in Write_category_t()
6732 Result += ",\n"; in Write_category_t()
6734 Result += "\t(const struct _method_list_t *)&"; in Write_category_t()
6735 Result += "_OBJC_$_CATEGORY_INSTANCE_METHODS_"; in Write_category_t()
6736 Result += ClassName; Result += "_$_"; Result += CatName; in Write_category_t()
6737 Result += ",\n"; in Write_category_t()
6740 Result += "\t0,\n"; in Write_category_t()
6743 Result += "\t(const struct _method_list_t *)&"; in Write_category_t()
6744 Result += "_OBJC_$_CATEGORY_CLASS_METHODS_"; in Write_category_t()
6745 Result += ClassName; Result += "_$_"; Result += CatName; in Write_category_t()
6746 Result += ",\n"; in Write_category_t()
6749 Result += "\t0,\n"; in Write_category_t()
6752 Result += "\t(const struct _protocol_list_t *)&"; in Write_category_t()
6753 Result += "_OBJC_CATEGORY_PROTOCOLS_$_"; in Write_category_t()
6754 Result += ClassName; Result += "_$_"; Result += CatName; in Write_category_t()
6755 Result += ",\n"; in Write_category_t()
6758 Result += "\t0,\n"; in Write_category_t()
6761 Result += "\t(const struct _prop_list_t *)&"; Result += "_OBJC_$_PROP_LIST_"; in Write_category_t()
6762 Result += ClassName; Result += "_$_"; Result += CatName; in Write_category_t()
6763 Result += ",\n"; in Write_category_t()
6766 Result += "\t0,\n"; in Write_category_t()
6768 Result += "};\n"; in Write_category_t()
6771 Result += "static void OBJC_CATEGORY_SETUP_$_"; in Write_category_t()
6772 Result += ClassDecl->getNameAsString(); in Write_category_t()
6773 Result += "_$_"; in Write_category_t()
6774 Result += CatName; in Write_category_t()
6775 Result += "(void ) {\n"; in Write_category_t()
6776 Result += "\t_OBJC_$_CATEGORY_"; in Write_category_t()
6777 Result += ClassDecl->getNameAsString(); in Write_category_t()
6778 Result += "_$_"; in Write_category_t()
6779 Result += CatName; in Write_category_t()
6780 Result += ".cls = "; Result += "&OBJC_CLASS_$_"; Result += ClassName; in Write_category_t()
6781 Result += ";\n}\n"; in Write_category_t()
6785 ASTContext *Context, std::string &Result, in Write__extendedMethodTypes_initializer() argument
6792 Result += "\nstatic const char *"; in Write__extendedMethodTypes_initializer()
6793 Result += VarName; Result += ProtocolName; in Write__extendedMethodTypes_initializer()
6794 Result += " [] __attribute__ ((used, section (\"__DATA,__objc_const\"))) = \n"; in Write__extendedMethodTypes_initializer()
6795 Result += "{\n"; in Write__extendedMethodTypes_initializer()
6801 Result += "\t\""; Result += QuoteMethodTypeString; Result += "\""; in Write__extendedMethodTypes_initializer()
6803 Result += "\n};\n"; in Write__extendedMethodTypes_initializer()
6805 Result += ",\n"; in Write__extendedMethodTypes_initializer()
6812 std::string &Result, in Write_IvarOffsetVar() argument
6826 Result += "\n"; in Write_IvarOffsetVar()
6830 Result += "__declspec(allocate(\".objc_ivar$B\")) "; in Write_IvarOffsetVar()
6835 Result += "extern \"C\" unsigned long int "; in Write_IvarOffsetVar()
6837 Result += "extern \"C\" __declspec(dllexport) unsigned long int "; in Write_IvarOffsetVar()
6839 RewriteObj.ObjCIvarBitfieldGroupOffset(IvarDecl, Result); in Write_IvarOffsetVar()
6841 WriteInternalIvarName(CDecl, IvarDecl, Result); in Write_IvarOffsetVar()
6842 Result += " __attribute__ ((used, section (\"__DATA,__objc_ivar\")))"; in Write_IvarOffsetVar()
6843 Result += " = "; in Write_IvarOffsetVar()
6844 RewriteObj.RewriteIvarOffsetComputation(IvarDecl, Result); in Write_IvarOffsetVar()
6845 Result += ";\n"; in Write_IvarOffsetVar()
6854 ASTContext *Context, std::string &Result, in Write__ivar_list_t_initializer() argument
6859 Write_IvarOffsetVar(RewriteObj, Context, Result, OriginalIvars, CDecl); in Write__ivar_list_t_initializer()
6874 Result += "\nstatic "; in Write__ivar_list_t_initializer()
6875 Write__ivar_list_t_TypeDecl(Result, Ivars.size()); in Write__ivar_list_t_initializer()
6876 Result += " "; Result += VarName; in Write__ivar_list_t_initializer()
6877 Result += CDecl->getNameAsString(); in Write__ivar_list_t_initializer()
6878 Result += " __attribute__ ((used, section (\"__DATA,__objc_const\"))) = {\n"; in Write__ivar_list_t_initializer()
6879 Result += "\t"; Result += "sizeof(_ivar_t)"; Result += ",\n"; in Write__ivar_list_t_initializer()
6880 Result += "\t"; Result += utostr(Ivars.size()); Result += ",\n"; in Write__ivar_list_t_initializer()
6884 Result += "\t{{"; in Write__ivar_list_t_initializer()
6886 Result += "\t {"; in Write__ivar_list_t_initializer()
6887 Result += "(unsigned long int *)&"; in Write__ivar_list_t_initializer()
6889 RewriteObj.ObjCIvarBitfieldGroupOffset(IvarDecl, Result); in Write__ivar_list_t_initializer()
6891 WriteInternalIvarName(CDecl, IvarDecl, Result); in Write__ivar_list_t_initializer()
6892 Result += ", "; in Write__ivar_list_t_initializer()
6894 Result += "\""; in Write__ivar_list_t_initializer()
6896 RewriteObj.ObjCIvarBitfieldGroupDecl(Ivars[i], Result); in Write__ivar_list_t_initializer()
6898 Result += IvarDecl->getName(); in Write__ivar_list_t_initializer()
6899 Result += "\", "; in Write__ivar_list_t_initializer()
6909 Result += "\""; Result += QuoteIvarTypeString; Result += "\", "; in Write__ivar_list_t_initializer()
6915 Result += llvm::utostr(Align); Result += ", "; in Write__ivar_list_t_initializer()
6917 Result += llvm::utostr(Size.getQuantity()); in Write__ivar_list_t_initializer()
6919 Result += "}}\n"; in Write__ivar_list_t_initializer()
6921 Result += "},\n"; in Write__ivar_list_t_initializer()
6923 Result += "};\n"; in Write__ivar_list_t_initializer()
6929 std::string &Result) { in RewriteObjCProtocolMetaData() argument
6934 WriteModernMetadataDeclarations(Context, Result); in RewriteObjCProtocolMetaData()
6941 RewriteObjCProtocolMetaData(I, Result); in RewriteObjCProtocolMetaData()
6971 Write__extendedMethodTypes_initializer(*this, Context, Result, in RewriteObjCProtocolMetaData()
6977 Write_protocol_list_initializer(Context, Result, SuperProtocols, in RewriteObjCProtocolMetaData()
6981 Write_method_list_t_initializer(*this, Context, Result, InstanceMethods, in RewriteObjCProtocolMetaData()
6985 Write_method_list_t_initializer(*this, Context, Result, ClassMethods, in RewriteObjCProtocolMetaData()
6989 Write_method_list_t_initializer(*this, Context, Result, OptInstanceMethods, in RewriteObjCProtocolMetaData()
6993 Write_method_list_t_initializer(*this, Context, Result, OptClassMethods, in RewriteObjCProtocolMetaData()
6999 Write_prop_list_t_initializer(*this, Context, Result, ProtocolProperties, in RewriteObjCProtocolMetaData()
7005 Result += "\n"; in RewriteObjCProtocolMetaData()
7007 Result += "static "; in RewriteObjCProtocolMetaData()
7008 Result += "struct _protocol_t _OBJC_PROTOCOL_"; in RewriteObjCProtocolMetaData()
7009 Result += PDecl->getNameAsString(); in RewriteObjCProtocolMetaData()
7010 Result += " __attribute__ ((used, section (\"__DATA,__datacoal_nt,coalesced\"))) = {\n"; in RewriteObjCProtocolMetaData()
7011 Result += "\t0,\n"; // id is; is null in RewriteObjCProtocolMetaData()
7012 Result += "\t\""; Result += PDecl->getNameAsString(); Result += "\",\n"; in RewriteObjCProtocolMetaData()
7014 Result += "\t(const struct _protocol_list_t *)&"; Result += "_OBJC_PROTOCOL_REFS_"; in RewriteObjCProtocolMetaData()
7015 Result += PDecl->getNameAsString(); Result += ",\n"; in RewriteObjCProtocolMetaData()
7018 Result += "\t0,\n"; in RewriteObjCProtocolMetaData()
7020 Result += "\t(const struct method_list_t *)&_OBJC_PROTOCOL_INSTANCE_METHODS_"; in RewriteObjCProtocolMetaData()
7021 Result += PDecl->getNameAsString(); Result += ",\n"; in RewriteObjCProtocolMetaData()
7024 Result += "\t0,\n"; in RewriteObjCProtocolMetaData()
7027 Result += "\t(const struct method_list_t *)&_OBJC_PROTOCOL_CLASS_METHODS_"; in RewriteObjCProtocolMetaData()
7028 Result += PDecl->getNameAsString(); Result += ",\n"; in RewriteObjCProtocolMetaData()
7031 Result += "\t0,\n"; in RewriteObjCProtocolMetaData()
7034 Result += "\t(const struct method_list_t *)&_OBJC_PROTOCOL_OPT_INSTANCE_METHODS_"; in RewriteObjCProtocolMetaData()
7035 Result += PDecl->getNameAsString(); Result += ",\n"; in RewriteObjCProtocolMetaData()
7038 Result += "\t0,\n"; in RewriteObjCProtocolMetaData()
7041 Result += "\t(const struct method_list_t *)&_OBJC_PROTOCOL_OPT_CLASS_METHODS_"; in RewriteObjCProtocolMetaData()
7042 Result += PDecl->getNameAsString(); Result += ",\n"; in RewriteObjCProtocolMetaData()
7045 Result += "\t0,\n"; in RewriteObjCProtocolMetaData()
7048 Result += "\t(const struct _prop_list_t *)&_OBJC_PROTOCOL_PROPERTIES_"; in RewriteObjCProtocolMetaData()
7049 Result += PDecl->getNameAsString(); Result += ",\n"; in RewriteObjCProtocolMetaData()
7052 Result += "\t0,\n"; in RewriteObjCProtocolMetaData()
7054 Result += "\t"; Result += "sizeof(_protocol_t)"; Result += ",\n"; in RewriteObjCProtocolMetaData()
7055 Result += "\t0,\n"; in RewriteObjCProtocolMetaData()
7058 Result += "\t(const char **)&"; Result += "_OBJC_PROTOCOL_METHOD_TYPES_"; in RewriteObjCProtocolMetaData()
7059 Result += PDecl->getNameAsString(); in RewriteObjCProtocolMetaData()
7060 Result += "\n};\n"; in RewriteObjCProtocolMetaData()
7063 Result += "\t0\n};\n"; in RewriteObjCProtocolMetaData()
7066 Result += "static "; in RewriteObjCProtocolMetaData()
7067 Result += "struct _protocol_t *"; in RewriteObjCProtocolMetaData()
7068 Result += "_OBJC_LABEL_PROTOCOL_$_"; Result += PDecl->getNameAsString(); in RewriteObjCProtocolMetaData()
7069 Result += " = &_OBJC_PROTOCOL_"; Result += PDecl->getNameAsString(); in RewriteObjCProtocolMetaData()
7070 Result += ";\n"; in RewriteObjCProtocolMetaData()
7081 std::string &Result) { in RewriteObjCProtocolListMetaData() argument
7085 RewriteObjCProtocolMetaData(Protocols[i], Result); in RewriteObjCProtocolListMetaData()
7094 Result += "\n"; in RewriteObjCProtocolListMetaData()
7096 Result += "__declspec(allocate(\".cat_cls_meth$B\")) "; in RewriteObjCProtocolListMetaData()
7097 Result += "static struct {\n"; in RewriteObjCProtocolListMetaData()
7098 Result += "\tstruct _objc_protocol_list *next;\n"; in RewriteObjCProtocolListMetaData()
7099 Result += "\tint protocol_count;\n"; in RewriteObjCProtocolListMetaData()
7100 Result += "\tstruct _objc_protocol *class_protocols["; in RewriteObjCProtocolListMetaData()
7101 Result += utostr(Protocols.size()); in RewriteObjCProtocolListMetaData()
7102 Result += "];\n} _OBJC_"; in RewriteObjCProtocolListMetaData()
7103 Result += prefix; in RewriteObjCProtocolListMetaData()
7104 Result += "_PROTOCOLS_"; in RewriteObjCProtocolListMetaData()
7105 Result += ClassName; in RewriteObjCProtocolListMetaData()
7106 Result += " __attribute__ ((used, section (\"__OBJC, __cat_cls_meth\")))= " in RewriteObjCProtocolListMetaData()
7108 Result += utostr(Protocols.size()); in RewriteObjCProtocolListMetaData()
7109 Result += "\n"; in RewriteObjCProtocolListMetaData()
7111 Result += "\t,{&_OBJC_PROTOCOL_"; in RewriteObjCProtocolListMetaData()
7112 Result += Protocols[0]->getNameAsString(); in RewriteObjCProtocolListMetaData()
7113 Result += " \n"; in RewriteObjCProtocolListMetaData()
7116 Result += "\t ,&_OBJC_PROTOCOL_"; in RewriteObjCProtocolListMetaData()
7117 Result += Protocols[i]->getNameAsString(); in RewriteObjCProtocolListMetaData()
7118 Result += "\n"; in RewriteObjCProtocolListMetaData()
7120 Result += "\t }\n};\n"; in RewriteObjCProtocolListMetaData()
7136 std::string &Result) { in RewriteObjCClassMetaData() argument
7144 WriteModernMetadataDeclarations(Context, Result); in RewriteObjCClassMetaData()
7155 Write__ivar_list_t_initializer(*this, Context, Result, IVars, in RewriteObjCClassMetaData()
7182 Write_method_list_t_initializer(*this, Context, Result, InstanceMethods, in RewriteObjCClassMetaData()
7188 Write_method_list_t_initializer(*this, Context, Result, ClassMethods, in RewriteObjCClassMetaData()
7202 RewriteObjCProtocolMetaData(*I, Result); in RewriteObjCClassMetaData()
7205 Write_protocol_list_initializer(Context, Result, in RewriteObjCClassMetaData()
7212 Write_prop_list_t_initializer(*this, Context, Result, ClassProperties, in RewriteObjCClassMetaData()
7233 Write__class_ro_t_initializer(Context, Result, flags, in RewriteObjCClassMetaData()
7272 Write__class_ro_t_initializer(Context, Result, flags, in RewriteObjCClassMetaData()
7281 Write_class_t(Context, Result, in RewriteObjCClassMetaData()
7285 Write_class_t(Context, Result, in RewriteObjCClassMetaData()
7294 void RewriteModernObjC::RewriteClassSetupInitHook(std::string &Result) { in RewriteClassSetupInitHook() argument
7298 Result += "#pragma section(\".objc_inithooks$B\", long, read, write)\n"; in RewriteClassSetupInitHook()
7299 Result += "__declspec(allocate(\".objc_inithooks$B\")) "; in RewriteClassSetupInitHook()
7300 Result += "static void *OBJC_CLASS_SETUP[] = {\n"; in RewriteClassSetupInitHook()
7304 Result += "\t(void *)&OBJC_CLASS_SETUP_$_"; in RewriteClassSetupInitHook()
7305 Result += CDecl->getName(); Result += ",\n"; in RewriteClassSetupInitHook()
7307 Result += "};\n"; in RewriteClassSetupInitHook()
7310 void RewriteModernObjC::RewriteMetaDataIntoBuffer(std::string &Result) { in RewriteMetaDataIntoBuffer() argument
7316 RewriteObjCClassMetaData(ClassImplementation[i], Result); in RewriteMetaDataIntoBuffer()
7318 RewriteClassSetupInitHook(Result); in RewriteMetaDataIntoBuffer()
7322 RewriteObjCCategoryImplDecl(CategoryImplementation[i], Result); in RewriteMetaDataIntoBuffer()
7324 RewriteCategorySetupInitHook(Result); in RewriteMetaDataIntoBuffer()
7328 Result += "__declspec(allocate(\".objc_classlist$B\")) "; in RewriteMetaDataIntoBuffer()
7329 Result += "static struct _class_t *L_OBJC_LABEL_CLASS_$ ["; in RewriteMetaDataIntoBuffer()
7330 Result += llvm::utostr(ClsDefCount); Result += "]"; in RewriteMetaDataIntoBuffer()
7331 Result += in RewriteMetaDataIntoBuffer()
7335 Result += "\t&OBJC_CLASS_$_"; in RewriteMetaDataIntoBuffer()
7336 Result += ClassImplementation[i]->getNameAsString(); in RewriteMetaDataIntoBuffer()
7337 Result += ",\n"; in RewriteMetaDataIntoBuffer()
7339 Result += "};\n"; in RewriteMetaDataIntoBuffer()
7343 Result += "__declspec(allocate(\".objc_nlclslist$B\")) \n"; in RewriteMetaDataIntoBuffer()
7344 Result += "static struct _class_t *_OBJC_LABEL_NONLAZY_CLASS_$[] = {\n\t"; in RewriteMetaDataIntoBuffer()
7346 Result += "\t&OBJC_CLASS_$_"; Result += DefinedNonLazyClasses[i]->getNameAsString(); in RewriteMetaDataIntoBuffer()
7347 Result += ",\n"; in RewriteMetaDataIntoBuffer()
7349 Result += "};\n"; in RewriteMetaDataIntoBuffer()
7355 Result += "__declspec(allocate(\".objc_catlist$B\")) "; in RewriteMetaDataIntoBuffer()
7356 Result += "static struct _category_t *L_OBJC_LABEL_CATEGORY_$ ["; in RewriteMetaDataIntoBuffer()
7357 Result += llvm::utostr(CatDefCount); Result += "]"; in RewriteMetaDataIntoBuffer()
7358 Result += in RewriteMetaDataIntoBuffer()
7362 Result += "\t&_OBJC_$_CATEGORY_"; in RewriteMetaDataIntoBuffer()
7363 Result += in RewriteMetaDataIntoBuffer()
7365 Result += "_$_"; in RewriteMetaDataIntoBuffer()
7366 Result += CategoryImplementation[i]->getNameAsString(); in RewriteMetaDataIntoBuffer()
7367 Result += ",\n"; in RewriteMetaDataIntoBuffer()
7369 Result += "};\n"; in RewriteMetaDataIntoBuffer()
7374 Result += "__declspec(allocate(\".objc_nlcatlist$B\")) \n"; in RewriteMetaDataIntoBuffer()
7375 Result += "static struct _category_t *_OBJC_LABEL_NONLAZY_CATEGORY_$[] = {\n\t"; in RewriteMetaDataIntoBuffer()
7377 Result += "\t&_OBJC_$_CATEGORY_"; in RewriteMetaDataIntoBuffer()
7378 Result += in RewriteMetaDataIntoBuffer()
7380 Result += "_$_"; in RewriteMetaDataIntoBuffer()
7381 Result += DefinedNonLazyCategories[i]->getNameAsString(); in RewriteMetaDataIntoBuffer()
7382 Result += ",\n"; in RewriteMetaDataIntoBuffer()
7384 Result += "};\n"; in RewriteMetaDataIntoBuffer()
7388 void RewriteModernObjC::WriteImageInfo(std::string &Result) { in WriteImageInfo() argument
7390 Result += "__declspec(allocate(\".objc_imageinfo$B\")) \n"; in WriteImageInfo()
7392 Result += "static struct IMAGE_INFO { unsigned version; unsigned flag; } "; in WriteImageInfo()
7394 Result += "_OBJC_IMAGE_INFO = { 0, 2 };\n"; in WriteImageInfo()
7400 std::string &Result) { in RewriteObjCCategoryImplDecl() argument
7401 WriteModernMetadataDeclarations(Context, Result); in RewriteObjCCategoryImplDecl()
7432 Write_method_list_t_initializer(*this, Context, Result, InstanceMethods, in RewriteObjCCategoryImplDecl()
7438 Write_method_list_t_initializer(*this, Context, Result, ClassMethods, in RewriteObjCCategoryImplDecl()
7448 RewriteObjCProtocolMetaData(I, Result); in RewriteObjCCategoryImplDecl()
7450 Write_protocol_list_initializer(Context, Result, in RewriteObjCCategoryImplDecl()
7457 Write_prop_list_t_initializer(*this, Context, Result, ClassProperties, in RewriteObjCCategoryImplDecl()
7462 Write_category_t(*this, Context, Result, in RewriteObjCCategoryImplDecl()
7476 void RewriteModernObjC::RewriteCategorySetupInitHook(std::string &Result) { in RewriteCategorySetupInitHook() argument
7480 Result += "#pragma section(\".objc_inithooks$B\", long, read, write)\n"; in RewriteCategorySetupInitHook()
7481 Result += "__declspec(allocate(\".objc_inithooks$B\")) "; in RewriteCategorySetupInitHook()
7482 Result += "static void *OBJC_CATEGORY_SETUP[] = {\n"; in RewriteCategorySetupInitHook()
7487 Result += "\t(void *)&OBJC_CATEGORY_SETUP_$_"; in RewriteCategorySetupInitHook()
7488 Result += ClassDecl->getName(); in RewriteCategorySetupInitHook()
7489 Result += "_$_"; in RewriteCategorySetupInitHook()
7490 Result += CatDecl->getName(); in RewriteCategorySetupInitHook()
7491 Result += ",\n"; in RewriteCategorySetupInitHook()
7493 Result += "};\n"; in RewriteCategorySetupInitHook()
7504 std::string &Result) { in RewriteObjCMethodsMetaData() argument
7514 Result += "\nstruct _objc_method {\n"; in RewriteObjCMethodsMetaData()
7515 Result += "\tSEL _cmd;\n"; in RewriteObjCMethodsMetaData()
7516 Result += "\tchar *method_types;\n"; in RewriteObjCMethodsMetaData()
7517 Result += "\tvoid *_imp;\n"; in RewriteObjCMethodsMetaData()
7518 Result += "};\n"; in RewriteObjCMethodsMetaData()
7532 Result += "\n"; in RewriteObjCMethodsMetaData()
7535 Result += "__declspec(allocate(\".inst_meth$B\")) "; in RewriteObjCMethodsMetaData()
7537 Result += "__declspec(allocate(\".cls_meth$B\")) "; in RewriteObjCMethodsMetaData()
7539 Result += "static struct {\n"; in RewriteObjCMethodsMetaData()
7540 Result += "\tstruct _objc_method_list *next_method;\n"; in RewriteObjCMethodsMetaData()
7541 Result += "\tint method_count;\n"; in RewriteObjCMethodsMetaData()
7542 Result += "\tstruct _objc_method method_list["; in RewriteObjCMethodsMetaData()
7543 Result += utostr(NumMethods); in RewriteObjCMethodsMetaData()
7544 Result += "];\n} _OBJC_"; in RewriteObjCMethodsMetaData()
7545 Result += prefix; in RewriteObjCMethodsMetaData()
7546 Result += IsInstanceMethod ? "INSTANCE" : "CLASS"; in RewriteObjCMethodsMetaData()
7547 Result += "_METHODS_"; in RewriteObjCMethodsMetaData()
7548 Result += ClassName; in RewriteObjCMethodsMetaData()
7549 Result += " __attribute__ ((used, section (\"__OBJC, __"; in RewriteObjCMethodsMetaData()
7550 Result += IsInstanceMethod ? "inst" : "cls"; in RewriteObjCMethodsMetaData()
7551 Result += "_meth\")))= "; in RewriteObjCMethodsMetaData()
7552 Result += "{\n\t0, " + utostr(NumMethods) + "\n"; in RewriteObjCMethodsMetaData()
7554 Result += "\t,{{(SEL)\""; in RewriteObjCMethodsMetaData()
7555 Result += (*MethodBegin)->getSelector().getAsString().c_str(); in RewriteObjCMethodsMetaData()
7558 Result += "\", \""; in RewriteObjCMethodsMetaData()
7559 Result += MethodTypeString; in RewriteObjCMethodsMetaData()
7560 Result += "\", (void *)"; in RewriteObjCMethodsMetaData()
7561 Result += MethodInternalNames[*MethodBegin]; in RewriteObjCMethodsMetaData()
7562 Result += "}\n"; in RewriteObjCMethodsMetaData()
7564 Result += "\t ,{(SEL)\""; in RewriteObjCMethodsMetaData()
7565 Result += (*MethodBegin)->getSelector().getAsString().c_str(); in RewriteObjCMethodsMetaData()
7568 Result += "\", \""; in RewriteObjCMethodsMetaData()
7569 Result += MethodTypeString; in RewriteObjCMethodsMetaData()
7570 Result += "\", (void *)"; in RewriteObjCMethodsMetaData()
7571 Result += MethodInternalNames[*MethodBegin]; in RewriteObjCMethodsMetaData()
7572 Result += "}\n"; in RewriteObjCMethodsMetaData()
7574 Result += "\t }\n};\n"; in RewriteObjCMethodsMetaData()