| 2333 | } |
| 2334 | |
| 2335 | void BlCodeView::DoFinish() |
| 2336 | { |
| 2337 | //TODO: |
| 2338 | //StopWorkThread(); |
| 2339 | |
| 2340 | int simpleRelocCount = 0; |
| 2341 | |
| 2342 | |
| 2343 | for (auto module : mModuleInfo) |
| 2344 | { |
| 2345 | if (module->mSymStreamIdx == -1) |
| 2346 | { |
| 2347 | //simpleRelocCount += OnlyHasSimpleRelocs(module); |
| 2348 | CreateModuleStream(module); |
| 2349 | } |
| 2350 | |
| 2351 | if (module->mDeferredSegOfsLen > 0) |
| 2352 | { |
| 2353 | FinishModuleStream(module); |
| 2354 | } |
| 2355 | } |
| 2356 | |
| 2357 | /*for (auto module : mModuleInfo) |
| 2358 | { |
| 2359 | String dbgStr = StrFormat("Module #%d:", module->mIdx); |
| 2360 | for (auto block : mStreams[module->mSymStreamIdx]->mBlocks) |
| 2361 | { |
| 2362 | dbgStr += StrFormat(" %d", block); |
| 2363 | } |
| 2364 | dbgStr += "\n"; |
| 2365 | OutputDebugStringA(dbgStr.c_str()); |
| 2366 | }*/ |
| 2367 | |
| 2368 | //StopWorkThread(); |
| 2369 | if (mContext->mFailed) |
| 2370 | { |
| 2371 | // We can't continue if any types may have failed |
| 2372 | return; |
| 2373 | } |
| 2374 | |
| 2375 | CreateDBIStream(); |
| 2376 | // CreateDBIStream does CreateGlobalsStream/CreatePublicsStream, so the symRecords |
| 2377 | // aren't done until after that |
| 2378 | FinishSymRecords(); |
| 2379 | |
| 2380 | CreateTypeStream(); |
| 2381 | CreateIPIStream(); |
| 2382 | CreateNamesStream(); |
| 2383 | CreateLinkInfoStream(); |
| 2384 | CreateHeaderBlockStream(); |
| 2385 | CreatePDBInfoStream(); |
| 2386 | |
| 2387 | // Stream dir |
| 2388 | //int streamDirLoc = mMSF.Alloc(); |
| 2389 | |
| 2390 | BlCVStream dirStream; |
| 2391 | StartUnnamedStream(dirStream); |
| 2392 | |