diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 13:13:10 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 13:13:10 +0000 |
commit | 7d523365ff1a3cc95bc058b33102500f61e8166d (patch) | |
tree | b466a4817f79516eb1df8eae92bccf62ecc84003 /contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp | |
parent | e3b65fde506060bec5cd110fcf03b440bd0eea1d (diff) | |
parent | dd58ef019b700900793a1eb48b52123db01b654e (diff) | |
download | src-7d523365ff1a3cc95bc058b33102500f61e8166d.tar.gz src-7d523365ff1a3cc95bc058b33102500f61e8166d.zip |
Update llvm to trunk r256633.
Notes
Notes:
svn path=/projects/clang380-import/; revision=292941
Diffstat (limited to 'contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp')
-rw-r--r-- | contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp b/contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp index f57eea20e2d9..2da5ae3200fd 100644 --- a/contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp +++ b/contrib/llvm/tools/llvm-readobj/Win64EHDumper.cpp @@ -149,11 +149,8 @@ static std::error_code resolveRelocation(const Dumper::Context &Ctx, return EC; ResolvedAddress = *ResolvedAddressOrErr; - section_iterator SI = Ctx.COFF.section_begin(); - if (std::error_code EC = Symbol.getSection(SI)) - return EC; - - ResolvedSection = Ctx.COFF.getCOFFSection(*SI); + ErrorOr<section_iterator> SI = Symbol.getSection(); + ResolvedSection = Ctx.COFF.getCOFFSection(**SI); return std::error_code(); } @@ -257,7 +254,7 @@ void Dumper::printUnwindInfo(const Context &Ctx, const coff_section *Section, return; } - printUnwindCode(UI, ArrayRef<UnwindCode>(UCI, UCE)); + printUnwindCode(UI, makeArrayRef(UCI, UCE)); UCI = UCI + UsedSlots - 1; } } @@ -284,11 +281,11 @@ void Dumper::printRuntimeFunction(const Context &Ctx, const coff_section *XData; uint64_t Offset; - if (error(resolveRelocation(Ctx, Section, SectionOffset + 8, XData, Offset))) - return; + resolveRelocation(Ctx, Section, SectionOffset + 8, XData, Offset); ArrayRef<uint8_t> Contents; - if (error(Ctx.COFF.getSectionContents(XData, Contents)) || Contents.empty()) + error(Ctx.COFF.getSectionContents(XData, Contents)); + if (Contents.empty()) return; Offset = Offset + RF.UnwindInfoOffset; @@ -302,15 +299,15 @@ void Dumper::printRuntimeFunction(const Context &Ctx, void Dumper::printData(const Context &Ctx) { for (const auto &Section : Ctx.COFF.sections()) { StringRef Name; - if (error(Section.getName(Name))) - continue; + Section.getName(Name); if (Name != ".pdata" && !Name.startswith(".pdata$")) continue; const coff_section *PData = Ctx.COFF.getCOFFSection(Section); ArrayRef<uint8_t> Contents; - if (error(Ctx.COFF.getSectionContents(PData, Contents)) || Contents.empty()) + error(Ctx.COFF.getSectionContents(PData, Contents)); + if (Contents.empty()) continue; const RuntimeFunction *Entries = |