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

Method CreateModuleStream

IDEHelper/Linker/BlCodeView.cpp:2115–2294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2113}
2114
2115void BlCodeView::CreateModuleStream(BlCvModuleInfo* module)
2116{
2117 BP_ZONE("BlCodeView::CreateModuleStream");
2118 //BL_AUTOPERF_CV("BlCodeView::CreateModuleStream");
2119
2120 //OutputDebugStrF("CreateModuleStream %d\n", module->mIdx);
2121
2122 //
2123 {
2124 BP_ZONE("BlCodeView::CreateModuleStream WaitForDoneSignal");
2125 /*if (module->mTypeSource != NULL)
2126 module->mTypeSource->mDoneSignal.WaitFor();*/
2127 }
2128
2129 if (mContext->mFailed)
2130 return;
2131
2132 module->mSymStreamIdx = StartStream();
2133
2134 mWriter.WriteT((int32)CV_SIGNATURE_C13);
2135 //int startPos = mWriter.GetStreamPos();
2136 if (module->mObjectData == NULL)
2137 {
2138 int startSize = mWriter.GetStreamPos();
2139
2140 if (module->mName == "* Linker *")
2141 CreateLinkerSymStream();
2142
2143 BlCvSymDataBlock data = { 0 };
2144 data.mOutSize = mWriter.GetStreamPos() - startSize;
2145 module->mSymData.push_back(data);
2146 }
2147 else
2148 {
2149 int dataOfs = 4;
2150
2151 /*const char* invalidStrs[] = { "delete_scalar", "new_scalar" };
2152 for (const char* invalidStr : invalidStrs)
2153 {
2154 //TODO:
2155 if (strstr(module->mObjectData->mName, invalidStr) != NULL)
2156 {
2157 module->mSymData.clear();
2158 module->mLineInfo.clear();
2159 module->mFileInfos.clear();
2160 break;
2161 }
2162 }*/
2163
2164 {
2165 BL_AUTOPERF_CV("BlCodeView::CreateModuleStream CreateModuleStreamSyms");
2166
2167 module->mDeferredSegOfsStart = (int)mDeferedSegOffsets.size();
2168 for (auto& block : module->mSymData)
2169 {
2170 CreateModuleStreamSyms(module, &block, dataOfs);
2171 dataOfs += block.mOutSize;
2172 }

Callers 1

RunMethod · 0.80

Calls 6

WriteTMethod · 0.45
GetStreamPosMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected