llvm.org GIT mirror llvm / 839b3c7
llvm-objdump: Use range-based-for loop and fix format. This is a small cleanup before making a bit larger change to this function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202770 91177308-0d34-0410-b5e6-96231b3b80d8 Rui Ueyama 5 years ago
1 changed file(s) with 18 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
413413 ArrayRef RFs(
414414 reinterpret_cast(Contents.data()),
415415 Contents.size() / sizeof(RuntimeFunction));
416 for (const RuntimeFunction *I = RFs.begin(), *E = RFs.end(); I < E; ++I) {
417 const uint64_t SectionOffset = std::distance(RFs.begin(), I)
418 * sizeof(RuntimeFunction);
416 for (const RuntimeFunction &RF : RFs) {
417 const uint64_t SectionOffset =
418 std::distance(RFs.begin(), &RF) * sizeof(RuntimeFunction);
419419
420420 outs() << "Function Table:\n";
421421
422422 outs() << " Start Address: ";
423 printCOFFSymbolAddress(outs(), Rels, SectionOffset +
424 /*offsetof(RuntimeFunction, StartAddress)*/ 0,
425 I->StartAddress);
423 printCOFFSymbolAddress(outs(), Rels,
424 SectionOffset +
425 /*offsetof(RuntimeFunction, StartAddress)*/ 0,
426 RF.StartAddress);
426427 outs() << "\n";
427428
428429 outs() << " End Address: ";
429 printCOFFSymbolAddress(outs(), Rels, SectionOffset +
430 /*offsetof(RuntimeFunction, EndAddress)*/ 4,
431 I->EndAddress);
430 printCOFFSymbolAddress(outs(), Rels,
431 SectionOffset +
432 /*offsetof(RuntimeFunction, EndAddress)*/ 4,
433 RF.EndAddress);
432434 outs() << "\n";
433435
434436 outs() << " Unwind Info Address: ";
435 printCOFFSymbolAddress(outs(), Rels, SectionOffset +
436 /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
437 I->UnwindInfoOffset);
437 printCOFFSymbolAddress(
438 outs(), Rels, SectionOffset +
439 /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
440 RF.UnwindInfoOffset);
438441 outs() << "\n";
439442
440443 ArrayRef XContents;
444447 XContents, UnwindInfoOffset))) continue;
445448 if (XContents.empty()) continue;
446449
447 UnwindInfoOffset += I->UnwindInfoOffset;
448 if (UnwindInfoOffset > XContents.size()) continue;
450 UnwindInfoOffset += RF.UnwindInfoOffset;
451 if (UnwindInfoOffset > XContents.size())
452 continue;
449453
450454 const Win64EH::UnwindInfo *UI =
451455 reinterpret_cast