mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
[C++11] Introduce ObjectFile::sections().
Summary: This adds ObjectFile::section_iterator_range, that allows to write range-based for-loops running over all sections of a given file. Several files from lib/ are converted to the new interface. Similar fixes should be applied to a variety of llvm-* tools. Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3069 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203799 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -313,16 +313,16 @@ static void printRelocationTargetName(const MachOObjectFile *O,
|
||||
|
||||
// If we couldn't find a symbol that this relocation refers to, try
|
||||
// to find a section beginning instead.
|
||||
for (section_iterator SI = O->section_begin(), SE = O->section_end();
|
||||
SI != SE; ++SI) {
|
||||
for (const SectionRef &Section : O->sections()) {
|
||||
error_code ec;
|
||||
uint64_t Addr;
|
||||
StringRef Name;
|
||||
|
||||
if ((ec = SI->getAddress(Addr)))
|
||||
if ((ec = Section.getAddress(Addr)))
|
||||
report_fatal_error(ec.message());
|
||||
if (Addr != Val) continue;
|
||||
if ((ec = SI->getName(Name)))
|
||||
if (Addr != Val)
|
||||
continue;
|
||||
if ((ec = Section.getName(Name)))
|
||||
report_fatal_error(ec.message());
|
||||
fmt << Name;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user