Lines Matching refs:G

152     auto G = createPlatformGraph(MOP, "<OrcRTCompleteBootstrap>");  in materialize()  local
154 G->createSection("__orc_rt_cplt_bs", MemProt::Read); in materialize()
156 G->createZeroFillBlock(PlaceholderSection, 1, ExecutorAddr(), 1, 0); in materialize()
157 G->addDefinedSymbol(PlaceholderBlock, 0, *CompleteBootstrapSymbol, 1, in materialize()
161 G->allocActions().reserve(DeferredAAs.size() + 3); in materialize()
164 G->allocActions().push_back( in materialize()
170 G->allocActions().push_back( in materialize()
178 G->allocActions().push_back( in materialize()
186 std::back_inserter(G->allocActions())); in materialize()
188 MOP.getObjectLinkingLayer().emit(std::move(R), std::move(G)); in materialize()
413 jitlink::Edge::Kind MachOPlatform::getPointerEdgeKind(jitlink::LinkGraph &G) { in getPointerEdgeKind() argument
414 switch (G.getTargetTriple().getArch()) { in getPointerEdgeKind()
760 [this](LinkGraph &G) { return bootstrapPipelineStart(G); }); in modifyPassConfig() argument
761 Config.PostAllocationPasses.push_back([this](LinkGraph &G) { in modifyPassConfig() argument
762 return bootstrapPipelineRecordRuntimeFunctions(G); in modifyPassConfig()
773 Config.PostAllocationPasses.push_back([this, &MR](LinkGraph &G) { in modifyPassConfig() argument
774 return associateJITDylibHeaderSymbol(G, MR); in modifyPassConfig()
782 Config.PrePrunePasses.push_back([this, &MR](LinkGraph &G) { in modifyPassConfig() argument
783 if (auto Err = preserveImportantSections(G, MR)) in modifyPassConfig()
785 return processObjCImageInfo(G, MR); in modifyPassConfig()
788 [this](LinkGraph &G) { return createObjCRuntimeObject(G); }); in modifyPassConfig() argument
790 [this, &MR](LinkGraph &G) { return populateObjCRuntimeObject(G, MR); }); in modifyPassConfig() argument
797 [this, &JD = MR.getTargetJITDylib()](LinkGraph &G) { in modifyPassConfig() argument
798 return fixTLVSectionsAndEdges(G, JD); in modifyPassConfig()
805 Config.PostPrunePasses.push_back([this, JITSymTabInfo](LinkGraph &G) { in modifyPassConfig() argument
806 return prepareSymbolTableRegistration(G, *JITSymTabInfo); in modifyPassConfig()
809 InBootstrapPhase](LinkGraph &G) { in modifyPassConfig() argument
810 return addSymbolTableRegistration(G, MR, *JITSymTabInfo, InBootstrapPhase); in modifyPassConfig()
816 [this, &JD = MR.getTargetJITDylib(), InBootstrapPhase](LinkGraph &G) { in modifyPassConfig() argument
817 return registerObjectPlatformSections(G, JD, InBootstrapPhase); in modifyPassConfig()
824 [this](LinkGraph &G) { return bootstrapPipelineEnd(G); }); in modifyPassConfig() argument
842 jitlink::LinkGraph &G) { in bootstrapPipelineStart() argument
850 bootstrapPipelineRecordRuntimeFunctions(jitlink::LinkGraph &G) { in bootstrapPipelineRecordRuntimeFunctions() argument
872 for (auto *Sym : G.defined_symbols()) { in bootstrapPipelineRecordRuntimeFunctions()
903 jitlink::LinkGraph &G) { in bootstrapPipelineEnd() argument
915 jitlink::LinkGraph &G, MaterializationResponsibility &MR) { in associateJITDylibHeaderSymbol() argument
916 auto I = llvm::find_if(G.defined_symbols(), [this](jitlink::Symbol *Sym) { in associateJITDylibHeaderSymbol()
919 assert(I != G.defined_symbols().end() && "Missing MachO header start symbol"); in associateJITDylibHeaderSymbol()
928 G.allocActions().push_back( in associateJITDylibHeaderSymbol()
938 jitlink::LinkGraph &G, MaterializationResponsibility &MR) { in preserveImportantSections() argument
944 G.findSectionByName(MachOObjCImageInfoSectionName)) { in preserveImportantSections()
947 "In " + G.getName() + in preserveImportantSections()
950 G.addAnonymousSymbol(**ObjCImageInfoSec->blocks().begin(), 0, 0, false, in preserveImportantSections()
955 return make_error<StringError>("In " + G.getName() + ", " + in preserveImportantSections()
972 auto *InitSection = G.findSectionByName(InitSectionName); in preserveImportantSections()
992 &G.addAnonymousSymbol(*B, 0, B->getSize(), false, true)); in preserveImportantSections()
1004 jitlink::LinkGraph &G, MaterializationResponsibility &MR) { in processObjCImageInfo() argument
1012 auto *ObjCImageInfo = G.findSectionByName(MachOObjCImageInfoSectionName); in processObjCImageInfo()
1021 " section in " + G.getName(), in processObjCImageInfo()
1028 " section in " + G.getName(), in processObjCImageInfo()
1033 for (auto &Sec : G.sections()) { in processObjCImageInfo()
1041 G.getName(), in processObjCImageInfo()
1047 auto Version = support::endian::read32(ObjCImageInfoData, G.getEndianness()); in processObjCImageInfo()
1049 support::endian::read32(ObjCImageInfoData + 4, G.getEndianness()); in processObjCImageInfo()
1060 "ObjC version in " + G.getName() + in processObjCImageInfo()
1064 if (Error E = mergeImageInfoFlags(G, MR, ObjCImageInfoItr->second, Flags)) in processObjCImageInfo()
1069 G.removeDefinedSymbol(*S); in processObjCImageInfo()
1070 G.removeBlock(ObjCImageInfoBlock); in processObjCImageInfo()
1074 << MR.getTargetJITDylib().getName() << " in " << G.getName() in processObjCImageInfo()
1079 G.addDefinedSymbol(ObjCImageInfoBlock, 0, ObjCImageInfoSymbolName, in processObjCImageInfo()
1093 jitlink::LinkGraph &G, MaterializationResponsibility &MR, in mergeImageInfoFlags() argument
1104 return make_error<StringError>("Swift ABI version in " + G.getName() + in mergeImageInfoFlags()
1110 G.getName() + in mergeImageInfoFlags()
1115 G.getName() + in mergeImageInfoFlags()
1137 << " with " << G.getName() << " (" << formatv("{0:x4}", NewFlags) in mergeImageInfoFlags()
1147 jitlink::LinkGraph &G, JITDylib &JD) { in fixTLVSectionsAndEdges() argument
1150 for (auto *Sym : G.external_symbols()) in fixTLVSectionsAndEdges()
1157 if (auto *ThreadDataSec = G.findSectionByName(MachOThreadVarsSectionName)) { in fixTLVSectionsAndEdges()
1174 support::endian::byte_swap(*Key, G.getEndianness()); in fixTLVSectionsAndEdges()
1177 if (B->getSize() != 3 * G.getPointerSize()) in fixTLVSectionsAndEdges()
1183 auto NewBlockContent = G.allocateBuffer(B->getSize()); in fixTLVSectionsAndEdges()
1185 memcpy(NewBlockContent.data() + G.getPointerSize(), &PlatformKeyBits, in fixTLVSectionsAndEdges()
1186 G.getPointerSize()); in fixTLVSectionsAndEdges()
1192 for (auto *B : G.blocks()) in fixTLVSectionsAndEdges()
1204 jitlink::LinkGraph &G) { in findUnwindSectionInfo() argument
1231 if (Section *EHFrameSec = G.findSectionByName(MachOEHFrameSectionName)) in findUnwindSectionInfo()
1235 G.findSectionByName(MachOCompactUnwindInfoSectionName)) in findUnwindSectionInfo()
1256 dbgs() << "MachOPlatform identified unwind info in " << G.getName() << ":\n" in findUnwindSectionInfo()
1270 if (US.CodeRanges.size() >= G.sections_size()) in findUnwindSectionInfo()
1279 jitlink::LinkGraph &G, JITDylib &JD, bool InBootstrapPhase) { in registerObjectPlatformSections() argument
1284 G.findSectionByName(MachOThreadDataSectionName); in registerObjectPlatformSections()
1287 if (auto *ThreadBSSSection = G.findSectionByName(MachOThreadBSSSectionName)) { in registerObjectPlatformSections()
1292 G.mergeSections(*ThreadDataSection, *ThreadBSSSection); in registerObjectPlatformSections()
1304 if (auto *Sec = G.findSectionByName(SecName)) { in registerObjectPlatformSections()
1325 auto *Sec = G.findSectionByName(SecName); in registerObjectPlatformSections()
1338 if (auto UI = findUnwindSectionInfo(G)) in registerObjectPlatformSections()
1345 dbgs() << "MachOPlatform: Scraped " << G.getName() << " init sections:\n"; in registerObjectPlatformSections()
1357 ? G.allocActions() in registerObjectPlatformSections()
1384 jitlink::LinkGraph &G) { in createObjCRuntimeObject() argument
1390 if (G.findSectionByName(ObjCRuntimeSectionName)) in createObjCRuntimeObject()
1394 if (G.findSectionByName(ObjCRuntimeSectionName)) { in createObjCRuntimeObject()
1412 auto &Sec = G.createSection(ObjCRuntimeObjectSectionName, in createObjCRuntimeObject()
1414 G.createMutableContentBlock(Sec, MachOSize, ExecutorAddr(), 16, 0, true); in createObjCRuntimeObject()
1420 jitlink::LinkGraph &G, MaterializationResponsibility &MR) { in populateObjCRuntimeObject() argument
1423 G.findSectionByName(ObjCRuntimeObjectSectionName); in populateObjCRuntimeObject()
1428 switch (G.getTargetTriple().getArch()) { in populateObjCRuntimeObject()
1435 G.getTargetTriple().str(), in populateObjCRuntimeObject()
1467 auto PointerEdge = getPointerEdgeKind(G); in populateObjCRuntimeObject()
1471 for (auto *Sym : G.external_symbols()) in populateObjCRuntimeObject()
1477 for (auto *Sym : G.absolute_symbols()) in populateObjCRuntimeObject()
1483 for (auto *Sym : G.defined_symbols()) in populateObjCRuntimeObject()
1499 auto Content = Sym->getBlock().getMutableContent(G); in populateObjCRuntimeObject()
1502 support::endian::write32(&Content[4], *Flags, G.getEndianness()); in populateObjCRuntimeObject()
1508 &G.addExternalSymbol(ObjCImageInfoSymbolName, 8, false); in populateObjCRuntimeObject()
1517 if (auto *GraphSec = G.findSectionByName(ObjCRuntimeSectionName)) { in populateObjCRuntimeObject()
1524 if (auto *GraphSec = G.findSectionByName(ObjCRuntimeSectionName)) { in populateObjCRuntimeObject()
1537 switch (G.getTargetTriple().getArch()) { in populateObjCRuntimeObject()
1561 if (G.getEndianness() != llvm::endianness::native) in populateObjCRuntimeObject()
1594 jitlink::LinkGraph &G, JITSymTabVector &JITSymTabInfo) { in prepareSymbolTableRegistration() argument
1596 auto *CStringSec = G.findSectionByName(MachOCStringSectionName); in prepareSymbolTableRegistration()
1598 CStringSec = &G.createSection(MachOCStringSectionName, in prepareSymbolTableRegistration()
1616 for (auto *Sym : G.defined_symbols()) in prepareSymbolTableRegistration()
1618 for (auto *Sym : G.absolute_symbols()) in prepareSymbolTableRegistration()
1627 auto &NameBlock = G.createMutableContentBlock( in prepareSymbolTableRegistration()
1628 *CStringSec, G.allocateCString(Sym->getName()), orc::ExecutorAddr(), in prepareSymbolTableRegistration()
1630 auto &SymbolNameSym = G.addAnonymousSymbol( in prepareSymbolTableRegistration()
1642 jitlink::LinkGraph &G, MaterializationResponsibility &MR, in addSymbolTableRegistration() argument
1667 ? G.allocActions() in addSymbolTableRegistration()
1681 JITDylib &JD, jitlink::LinkGraph &G, in createHeaderBlock() argument
1704 auto HeaderContent = G.allocateBuffer(B.layout()); in createHeaderBlock()
1707 return G.createContentBlock(HeaderSection, HeaderContent, ExecutorAddr(), 8, in createHeaderBlock()
1720 auto G = createPlatformGraph(MOP, "<MachOHeaderMU>"); in materialize() local
1721 addMachOHeader(R->getTargetJITDylib(), *G, R->getInitializerSymbol()); in materialize()
1722 MOP.getObjectLinkingLayer().emit(std::move(R), std::move(G)); in materialize()
1729 JITDylib &JD, jitlink::LinkGraph &G, in addMachOHeader() argument
1731 auto &HeaderSection = G.createSection("__header", MemProt::Read); in addMachOHeader()
1732 auto &HeaderBlock = createHeaderBlock(JD, G, HeaderSection); in addMachOHeader()
1735 G.addDefinedSymbol(HeaderBlock, 0, *InitializerSymbol, HeaderBlock.getSize(), in addMachOHeader()
1739 G.addDefinedSymbol(HeaderBlock, HS.Offset, HS.Name, HeaderBlock.getSize(), in addMachOHeader()
1745 SimpleMachOHeaderMU::createHeaderBlock(JITDylib &JD, jitlink::LinkGraph &G, in createHeaderBlock() argument
1750 return ::createHeaderBlock<MachO64LE>(MOP, Opts, JD, G, HeaderSection); in createHeaderBlock()