MCPcopy Create free account
hub / github.com/beefytech/Beef / CheckModuleStringRefs

Method CheckModuleStringRefs

IDEHelper/Compiler/BfCompiler.cpp:625–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625void BfCompiler::CheckModuleStringRefs(BfModule* module, BfVDataModule* vdataModule, int lastModuleRevision, HashSet<int>& foundStringIds, HashSet<int>& dllNameSet, Array<BfMethodInstance*>& dllMethods, Array<BfCompiler::StringValueEntry>& stringValueEntries)
626{
627 for (int stringId : module->mStringPoolRefs)
628 {
629 if (foundStringIds.Add(stringId))
630 {
631 BfStringPoolEntry& stringPoolEntry = module->mContext->mStringObjectIdMap[stringId];
632
633 if (IsHotCompile())
634 {
635 if (vdataModule->mDefinedStrings.Contains(stringId))
636 continue;
637 }
638
639 StringValueEntry stringEntry;
640 stringEntry.mId = stringId;
641
642 vdataModule->mDefinedStrings.Add(stringId);
643 stringEntry.mStringVal = vdataModule->CreateStringObjectValue(stringPoolEntry.mString, stringId, true);
644 stringValueEntries.Add(stringEntry);
645
646 CompileLog("String %d %s\n", stringId, stringPoolEntry.mString.c_str());
647 }
648 }
649
650 for (auto dllNameId : module->mImportFileNames)
651 dllNameSet.Add(dllNameId);
652
653 for (auto& dllImportEntry : module->mDllImportEntries)
654 dllMethods.push_back(dllImportEntry.mMethodInstance);
655
656 auto altModule = module->mNextAltModule;
657 while (altModule != NULL)
658 {
659 CheckModuleStringRefs(altModule, vdataModule, lastModuleRevision, foundStringIds, dllNameSet, dllMethods, stringValueEntries);
660 altModule = altModule->mNextAltModule;
661 }
662
663 for (auto& specModulePair : module->mSpecializedMethodModules)
664 CheckModuleStringRefs(specModulePair.mValue, vdataModule, lastModuleRevision, foundStringIds, dllNameSet, dllMethods, stringValueEntries);
665}
666
667void BfCompiler::HashModuleVData(BfModule* module, HashContext& vdataHash)
668{

Callers

nothing calls this directly

Calls 5

AddMethod · 0.45
ContainsMethod · 0.45
c_strMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected