<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 19, 2015 at 10:51 AM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: lhames<br>
Date: Fri Jun 19 12:51:46 2015<br>
New Revision: 240147<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D240147-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=p54TlPErNRPS78C7Hc8jS6yg_7ZRFrJSq_vErPn8R9Q&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=240147&view=rev</a><br>
Log:<br>
[lld] Allow LLD passes to return error codes.<br></blockquote><div><br>Saw this & took the opportunity to simplify the API a bit (unique_ptr<SimpleFile>& -> SimpleFile&) in r240167<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Modified:<br>
lld/trunk/include/lld/Core/Pass.h<br>
lld/trunk/include/lld/Core/PassManager.h<br>
lld/trunk/lib/Driver/Driver.cpp<br>
lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp<br>
lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp<br>
lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp<br>
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h<br>
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp<br>
lld/trunk/lib/ReaderWriter/ELF/OrderPass.h<br>
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp<br>
lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp<br>
lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp<br>
lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp<br>
lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h<br>
lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp<br>
lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp<br>
lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp<br>
lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h<br>
lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp<br>
lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h<br>
lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h<br>
lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp<br>
lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h<br>
lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h<br>
lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h<br>
<br>
Modified: lld/trunk/include/lld/Core/Pass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_include_lld_Core_Pass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=wSOVAmkVngSCY81v6ZEp5Q19SxCIDV56MTr_C_ixSOI&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Pass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/include/lld/Core/Pass.h (original)<br>
+++ lld/trunk/include/lld/Core/Pass.h Fri Jun 19 12:51:46 2015<br>
@@ -34,7 +34,7 @@ public:<br>
virtual ~Pass() { }<br>
<br>
/// Do the actual work of the Pass.<br>
- virtual void perform(std::unique_ptr<SimpleFile> &mergedFile) = 0;<br>
+ virtual std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) = 0;<br>
<br>
protected:<br>
// Only subclassess can be instantiated.<br>
<br>
Modified: lld/trunk/include/lld/Core/PassManager.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_include_lld_Core_PassManager.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=e13wTHxA6XUOBM0tF6_Gia6ly46LW5_OFAJoC5z1rXc&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/PassManager.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/include/lld/Core/PassManager.h (original)<br>
+++ lld/trunk/include/lld/Core/PassManager.h Fri Jun 19 12:51:46 2015<br>
@@ -33,7 +33,8 @@ public:<br>
<br>
std::error_code runOnFile(std::unique_ptr<SimpleFile> &file) {<br>
for (std::unique_ptr<Pass> &pass : _passes)<br>
- pass->perform(file);<br>
+ if (std::error_code EC = pass->perform(file))<br>
+ return EC;<br>
return std::error_code();<br>
}<br>
<br>
<br>
Modified: lld/trunk/lib/Driver/Driver.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_Driver_Driver.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=t8V8IDLFbGFUFK0BSK0F8FIWN0H-aRUFnIh7EKPQwCA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/Driver.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/Driver/Driver.cpp (original)<br>
+++ lld/trunk/lib/Driver/Driver.cpp Fri Jun 19 12:51:46 2015<br>
@@ -117,7 +117,12 @@ bool Driver::link(LinkingContext &ctx, r<br>
ScopedTask passTask(getDefaultDomain(), "Passes");<br>
PassManager pm;<br>
ctx.addPasses(pm);<br>
- pm.runOnFile(merged);<br>
+ if (std::error_code ec = pm.runOnFile(merged)) {<br>
+ diagnostics << "Failed to write file '" << ctx.outputPath()<br>
+ << "': " << ec.message() << "\n";<br>
+ return false;<br>
+ }<br>
+<br>
passTask.end();<br>
<br>
// Give linked atoms to Writer to generate output file.<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_CoreLinkingContext.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=f9xhi8Vz6-OuBUJMXOhqVc3tyNDxZIVQwBWmvA-PzmQ&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp Fri Jun 19 12:51:46 2015<br>
@@ -22,9 +22,10 @@ namespace {<br>
class OrderPass : public Pass {<br>
public:<br>
/// Sorts atoms by position<br>
- void perform(std::unique_ptr<SimpleFile> &file) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override {<br>
SimpleFile::DefinedAtomRange defined = file->definedAtoms();<br>
std::sort(defined.begin(), defined.end(), DefinedAtom::compareByPosition);<br>
+ return std::error_code();<br>
}<br>
};<br>
<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_AArch64_AArch64RelocationPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=KS2kU2U9edVATII21dDltBIxMzmw2BdQztNCpwlvId4&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -256,7 +256,7 @@ public:<br>
///<br>
/// After all references are handled, the atoms created during that are all<br>
/// added to mf.<br>
- void perform(std::unique_ptr<SimpleFile> &mf) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {<br>
ScopedTask task(getDefaultDomain(), "AArch64 GOT/PLT Pass");<br>
DEBUG_WITH_TYPE(<br>
"AArch64", llvm::dbgs() << "Undefined Atoms"<br>
@@ -315,6 +315,8 @@ public:<br>
obj->setOrdinal(ordinal++);<br>
mf->addAtom(*obj);<br>
}<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
protected:<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_ARM_ARMRelocationPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=whJrIguha4ll18RpCTwN-GHczWjSQ4UFpA1Q5o6DA7M&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -673,7 +673,7 @@ public:<br>
///<br>
/// After all references are handled, the atoms created during that are all<br>
/// added to mf.<br>
- void perform(std::unique_ptr<SimpleFile> &mf) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {<br>
ScopedTask task(getDefaultDomain(), "ARM GOT/PLT Pass");<br>
DEBUG_WITH_TYPE(<br>
"ARM", llvm::dbgs() << "Undefined Atoms" << "\n";<br>
@@ -759,6 +759,8 @@ public:<br>
v->setOrdinal(ordinal++);<br>
mf->addAtom(*v);<br>
}<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
protected:<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_Hexagon_HexagonTargetHandler.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=RYeOVmcVNaDgw9XyQBA1D-ybPQt1Wfcm8cDIEMvVbE4&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Fri Jun 19 12:51:46 2015<br>
@@ -169,7 +169,7 @@ public:<br>
///<br>
/// After all references are handled, the atoms created during that are all<br>
/// added to mf.<br>
- void perform(std::unique_ptr<SimpleFile> &mf) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {<br>
// Process all references.<br>
for (const auto &atom : mf->defined())<br>
for (const auto &ref : *atom)<br>
@@ -197,6 +197,8 @@ public:<br>
got->setOrdinal(ordinal++);<br>
mf->addAtom(*got);<br>
}<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
protected:<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_Mips_MipsCtorsOrderPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=C7T2q6KiwLj88GXSEg26VF1I4btRdQAAl32bUNwvrZA&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -49,7 +49,7 @@ static int32_t getSectionPriority(String<br>
return priority;<br>
}<br>
<br>
-void MipsCtorsOrderPass::perform(std::unique_ptr<SimpleFile> &f) {<br>
+std::error_code MipsCtorsOrderPass::perform(std::unique_ptr<SimpleFile> &f) {<br>
auto definedAtoms = f->definedAtoms();<br>
<br>
auto last = std::stable_partition(definedAtoms.begin(), definedAtoms.end(),<br>
@@ -71,4 +71,6 @@ void MipsCtorsOrderPass::perform(std::un<br>
<br>
return leftPriority < rightPriority;<br>
});<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_Mips_MipsCtorsOrderPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=juqXDT1ocxzMkSEQlffEIOIpj51l1fDvcB3f7hxHvA8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h Fri Jun 19 12:51:46 2015<br>
@@ -17,7 +17,7 @@ namespace elf {<br>
/// \brief This pass sorts atoms in .{ctors,dtors}.<priority> sections.<br>
class MipsCtorsOrderPass : public Pass {<br>
public:<br>
- void perform(std::unique_ptr<SimpleFile> &mergedFile) override;<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override;<br>
};<br>
}<br>
}<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_Mips_MipsRelocationPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=CDAHqLXdQ4UmeTidkonCj4bmyv2LQCdt3JVAEiBFSHQ&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -302,7 +302,7 @@ template <typename ELFT> class Relocatio<br>
public:<br>
RelocationPass(MipsLinkingContext &ctx);<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &mf) override;<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mf) override;<br>
<br>
private:<br>
/// \brief Reference to the linking context.<br>
@@ -428,7 +428,7 @@ RelocationPass<ELFT>::RelocationPass(Mip<br>
}<br>
<br>
template <typename ELFT><br>
-void RelocationPass<ELFT>::perform(std::unique_ptr<SimpleFile> &mf) {<br>
+std::error_code RelocationPass<ELFT>::perform(std::unique_ptr<SimpleFile> &mf) {<br>
for (const auto &atom : mf->defined())<br>
for (const auto &ref : *atom)<br>
collectReferenceInfo(*cast<MipsELFDefinedAtom<ELFT>>(atom),<br>
@@ -518,6 +518,8 @@ void RelocationPass<ELFT>::perform(std::<br>
la25->setOrdinal(ordinal++);<br>
mf->addAtom(*la25);<br>
}<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
template <typename ELFT><br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/OrderPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_OrderPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=106p5e2_0R3y-im3zojkA_QcSHYX7O0OHpRhq02ymU8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OrderPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/OrderPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/OrderPass.h Fri Jun 19 12:51:46 2015<br>
@@ -19,9 +19,10 @@ namespace elf {<br>
/// \brief This pass sorts atoms by file and atom ordinals.<br>
class OrderPass : public Pass {<br>
public:<br>
- void perform(std::unique_ptr<SimpleFile> &file) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override {<br>
parallel_sort(file->definedAtoms().begin(), file->definedAtoms().end(),<br>
DefinedAtom::compareByPosition);<br>
+ return std::error_code();<br>
}<br>
};<br>
}<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_ELF_X86-5F64_X86-5F64RelocationPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=S_QAz8HpGR0yXXTqzqx5gfMSzsskAFfxx2SQjZvu23c&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -254,7 +254,7 @@ public:<br>
///<br>
/// After all references are handled, the atoms created during that are all<br>
/// added to mf.<br>
- void perform(std::unique_ptr<SimpleFile> &mf) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {<br>
ScopedTask task(getDefaultDomain(), "X86-64 GOT/PLT Pass");<br>
// Process all references.<br>
for (const auto &atom : mf->defined())<br>
@@ -293,6 +293,7 @@ public:<br>
obj->setOrdinal(ordinal++);<br>
mf->addAtom(*obj);<br>
}<br>
+ return std::error_code();<br>
}<br>
<br>
protected:<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_MachO_CompactUnwindPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=gKmi1sD2SXVR2JIrbOhxD1wXTpNCWVXxgWUgQUO7WEY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -277,7 +277,7 @@ public:<br>
_isBig(MachOLinkingContext::isBigEndian(_ctx.arch())) {}<br>
<br>
private:<br>
- void perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
DEBUG(llvm::dbgs() << "MachO Compact Unwind pass\n");<br>
<br>
std::map<const Atom *, CompactUnwindEntry> unwindLocs;<br>
@@ -294,7 +294,7 @@ private:<br>
<br>
// Skip rest of pass if no unwind info.<br>
if (unwindLocs.empty() && dwarfFrames.empty())<br>
- return;<br>
+ return std::error_code();<br>
<br>
// FIXME: if there are more than 4 personality functions then we need to<br>
// defer to DWARF info for the ones we don't put in the list. They should<br>
@@ -348,6 +348,8 @@ private:<br>
mergedFile->removeDefinedAtomsIf([](const DefinedAtom *atom) {<br>
return atom->contentType() == DefinedAtom::typeCompactUnwindInfo;<br>
});<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
void collectCompactUnwindEntries(<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_MachO_GOTPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=SrzByqNae2hZ1IjDsRrPjjlJPSJdwblPYylOyjdfkWY&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -96,7 +96,7 @@ public:<br>
_file("<mach-o GOT Pass>") {}<br>
<br>
private:<br>
- void perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
// Scan all references in all atoms.<br>
for (const DefinedAtom *atom : mergedFile->defined()) {<br>
for (const Reference *ref : *atom) {<br>
@@ -131,6 +131,8 @@ private:<br>
});<br>
for (const GOTEntryAtom *slot : entries)<br>
mergedFile->addAtom(*slot);<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
bool shouldReplaceTargetWithGOTAtom(const Atom *target, bool canBypassGOT) {<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_MachO_LayoutPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=bpICTDSBHT35P6xZiYj-VSCqOI7HLeUxa1mha8kTIN8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -437,7 +437,7 @@ void LayoutPass::undecorate(SimpleFile::<br>
}<br>
<br>
/// Perform the actual pass<br>
-void LayoutPass::perform(std::unique_ptr<SimpleFile> &mergedFile) {<br>
+std::error_code LayoutPass::perform(std::unique_ptr<SimpleFile> &mergedFile) {<br>
// sort the atoms<br>
ScopedTask task(getDefaultDomain(), "LayoutPass");<br>
SimpleFile::DefinedAtomRange atomRange = mergedFile->definedAtoms();<br>
@@ -468,6 +468,8 @@ void LayoutPass::perform(std::unique_ptr<br>
llvm::dbgs() << "sorted atoms:\n";<br>
printDefinedAtoms(atomRange);<br>
});<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
void addLayoutPass(PassManager &pm, const MachOLinkingContext &ctx) {<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_MachO_LayoutPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=HYFZ9lf6I1Ba1IE-GwGjHIv8Nr4foimUure4BxAtf8g&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h Fri Jun 19 12:51:46 2015<br>
@@ -46,7 +46,7 @@ public:<br>
LayoutPass(const Registry ®istry, SortOverride sorter);<br>
<br>
/// Sorts atoms in mergedFile by content type then by command line order.<br>
- void perform(std::unique_ptr<SimpleFile> &mergedFile) override;<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override;<br>
<br>
virtual ~LayoutPass() {}<br>
<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_MachO_ShimPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=FnuBanpHPpSi7-NWbxOoXjIkwjOJGkEdGwhVnToVGPk&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -44,7 +44,7 @@ public:<br>
: _ctx(context), _archHandler(_ctx.archHandler()),<br>
_stubInfo(_archHandler.stubInfo()), _file("<mach-o shim pass>") {}<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
// Scan all references in all atoms.<br>
for (const DefinedAtom *atom : mergedFile->defined()) {<br>
for (const Reference *ref : *atom) {<br>
@@ -63,7 +63,7 @@ public:<br>
}<br>
// Exit early if no shims needed.<br>
if (_targetToShim.empty())<br>
- return;<br>
+ return std::error_code();<br>
<br>
// Sort shim atoms so the layout order is stable.<br>
std::vector<const DefinedAtom *> shims;<br>
@@ -80,6 +80,8 @@ public:<br>
for (const DefinedAtom *shim : shims) {<br>
mergedFile->addAtom(*shim);<br>
}<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
private:<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_MachO_StubsPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=s143xyMLSJz54Ko58ko4rEPx6mURC7j-xsByHkQNfcs&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -209,10 +209,10 @@ public:<br>
: _ctx(context), _archHandler(_ctx.archHandler()),<br>
_stubInfo(_archHandler.stubInfo()), _file("<mach-o Stubs pass>") {}<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {<br>
// Skip this pass if output format uses text relocations instead of stubs.<br>
if (!this->noTextRelocs())<br>
- return;<br>
+ return std::error_code();<br>
<br>
// Scan all references in all atoms.<br>
for (const DefinedAtom *atom : mergedFile->defined()) {<br>
@@ -239,7 +239,7 @@ public:<br>
<br>
// Exit early if no stubs needed.<br>
if (_targetToUses.empty())<br>
- return;<br>
+ return std::error_code();<br>
<br>
// First add help-common and GOT slots used by lazy binding.<br>
SimpleDefinedAtom *helperCommonAtom =<br>
@@ -314,6 +314,8 @@ public:<br>
// Calculate new offset<br>
lazyOffset += target->name().size() + 12;<br>
}<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
private:<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_EdataPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=loGpGp6wSILfhRWv8vLaKQdthpbPK4GOIQTnrnH57z0&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -175,15 +175,15 @@ EdataPass::createOrdinalTable(const std:<br>
return ret;<br>
}<br>
<br>
-void EdataPass::perform(std::unique_ptr<SimpleFile> &file) {<br>
+std::error_code EdataPass::perform(std::unique_ptr<SimpleFile> &file) {<br>
dedupExports(_ctx);<br>
assignOrdinals(_ctx);<br>
<br>
std::vector<TableEntry> entries;<br>
if (!getExportedAtoms(_ctx, file.get(), entries))<br>
- return;<br>
+ return std::error_code();<br>
if (entries.empty())<br>
- return;<br>
+ return std::error_code();<br>
<br>
int ordinalBase, maxOrdinal;<br>
std::tie(ordinalBase, maxOrdinal) = getOrdinalBase(entries);<br>
@@ -221,6 +221,8 @@ void EdataPass::perform(std::unique_ptr<<br>
file->addAtom(*ordinalTable);<br>
addDir32NBReloc(table, ordinalTable, _ctx.getMachineType(),<br>
offsetof(export_directory_table_entry, OrdinalTableRVA));<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
} // namespace pecoff<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_EdataPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=ld39HiUow9696f2bSloqliK9yeompwkBh3OuZqp5tXg&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h Fri Jun 19 12:51:46 2015<br>
@@ -66,7 +66,7 @@ public:<br>
EdataPass(PECOFFLinkingContext &ctx)<br>
: _ctx(ctx), _file(ctx), _is64(ctx.is64Bit()), _stringOrdinal(1024) {}<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &file) override;<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override;<br>
<br>
private:<br>
edata::EdataAtom *<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_IdataPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=sXKFr2CWVdE-LFLE_9gEbBMokdPK5g3gll5d5guT1v8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -287,9 +287,9 @@ DelayLoaderAtom::createContent(MachineTy<br>
<br>
} // namespace idata<br>
<br>
-void IdataPass::perform(std::unique_ptr<SimpleFile> &file) {<br>
+std::error_code IdataPass::perform(std::unique_ptr<SimpleFile> &file) {<br>
if (file->sharedLibrary().empty())<br>
- return;<br>
+ return std::error_code();<br>
<br>
idata::IdataContext context(*file, _dummyFile, _ctx);<br>
std::map<StringRef, std::vector<COFFSharedLibraryAtom *>> sharedAtoms =<br>
@@ -322,6 +322,8 @@ void IdataPass::perform(std::unique_ptr<<br>
new (_alloc) idata::DelayNullImportDirectoryAtom(context);<br>
<br>
replaceSharedLibraryAtoms(*file);<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
std::map<StringRef, std::vector<COFFSharedLibraryAtom *>><br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_IdataPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=_0EogAeWUJ_ORGpdWn1fZlC1cbXkIczjiqFrYkCxtco&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h Fri Jun 19 12:51:46 2015<br>
@@ -195,7 +195,7 @@ class IdataPass : public lld::Pass {<br>
public:<br>
IdataPass(const PECOFFLinkingContext &ctx) : _dummyFile(ctx), _ctx(ctx) {}<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &file) override;<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override;<br>
<br>
private:<br>
std::map<StringRef, std::vector<COFFSharedLibraryAtom *>><br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_InferSubsystemPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=mAE7MIPLOZNJHT5jMBhMlgt9fJyy4MuLmzLrIC_kwJc&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h Fri Jun 19 12:51:46 2015<br>
@@ -22,13 +22,13 @@ class InferSubsystemPass : public lld::P<br>
public:<br>
InferSubsystemPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {}<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &file) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override {<br>
if (_ctx.getSubsystem() != WindowsSubsystem::IMAGE_SUBSYSTEM_UNKNOWN)<br>
- return;<br>
+ return std::error_code();<br>
<br>
if (_ctx.isDll()) {<br>
_ctx.setSubsystem(WindowsSubsystem::IMAGE_SUBSYSTEM_WINDOWS_GUI);<br>
- return;<br>
+ return std::error_code();<br>
}<br>
<br>
// Scan the resolved symbols to infer the subsystem.<br>
@@ -45,15 +45,17 @@ public:<br>
if (atom->name() == wWinMain || atom->name().startswith(wWinMainAt) ||<br>
atom->name() == winMain || atom->name().startswith(winMainAt)) {<br>
_ctx.setSubsystem(WindowsSubsystem::IMAGE_SUBSYSTEM_WINDOWS_GUI);<br>
- return;<br>
+ return std::error_code();<br>
}<br>
if (atom->name() == wmain || atom->name().startswith(wmainAt) ||<br>
atom->name() == main || atom->name().startswith(mainAt)) {<br>
_ctx.setSubsystem(WindowsSubsystem::IMAGE_SUBSYSTEM_WINDOWS_CUI);<br>
- return;<br>
+ return std::error_code();<br>
}<br>
}<br>
llvm::report_fatal_error("Failed to infer subsystem");<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
private:<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_LoadConfigPass.cpp-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=NA9pwWWdYBjnyJmmTp2tnhErHAQZXgm_RK_usgeHt5U&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp Fri Jun 19 12:51:46 2015<br>
@@ -49,9 +49,9 @@ LoadConfigAtom::LoadConfigAtom(VirtualFi<br>
<br>
} // namespace loadcfg<br>
<br>
-void LoadConfigPass::perform(std::unique_ptr<SimpleFile> &file) {<br>
+std::error_code LoadConfigPass::perform(std::unique_ptr<SimpleFile> &file) {<br>
if (_ctx.noSEH())<br>
- return;<br>
+ return std::error_code();<br>
<br>
// Find the first atom in .sxdata section.<br>
const DefinedAtom *sxdata = nullptr;<br>
@@ -64,11 +64,13 @@ void LoadConfigPass::perform(std::unique<br>
}<br>
}<br>
if (!sxdata)<br>
- return;<br>
+ return std::error_code();<br>
<br>
auto *loadcfg = new (_alloc)<br>
loadcfg::LoadConfigAtom(_file, sxdata, sectionSize / sizeof(uint32_t));<br>
file->addAtom(*loadcfg);<br>
+<br>
+ return std::error_code();<br>
}<br>
<br>
} // namespace pecoff<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_LoadConfigPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=c9bfedLu2EuPylqb5Z4nMEkLzo0_GCOuppAVfVzMu80&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h Fri Jun 19 12:51:46 2015<br>
@@ -49,7 +49,7 @@ class LoadConfigPass : public lld::Pass<br>
public:<br>
LoadConfigPass(PECOFFLinkingContext &ctx) : _ctx(ctx), _file(ctx) {}<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &file) override;<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override;<br>
<br>
private:<br>
PECOFFLinkingContext &_ctx;<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_OrderPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=YxAPrnx491JjRPC2gFOafwV3DaiFwUrGZDYOdxKSZMc&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h Fri Jun 19 12:51:46 2015<br>
@@ -55,9 +55,10 @@ static bool compare(const DefinedAtom *l<br>
<br>
class OrderPass : public lld::Pass {<br>
public:<br>
- void perform(std::unique_ptr<SimpleFile> &file) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override {<br>
SimpleFile::DefinedAtomRange defined = file->definedAtoms();<br>
parallel_sort(defined.begin(), defined.end(), compare);<br>
+ return std::error_code();<br>
}<br>
};<br>
<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_lib_ReaderWriter_PECOFF_PDBPass.h-3Frev-3D240147-26r1-3D240146-26r2-3D240147-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=uMxQH3TaxrXUTJfkbJVX6Dyx_S2H_uhLHX3TUGkSbH8&s=htOhZPqgq3F9Wbp5AUXgVr_H4brEQzwQLcCAmwbyMB4&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h?rev=240147&r1=240146&r2=240147&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h Fri Jun 19 12:51:46 2015<br>
@@ -21,9 +21,10 @@ class PDBPass : public lld::Pass {<br>
public:<br>
PDBPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {}<br>
<br>
- void perform(std::unique_ptr<SimpleFile> &file) override {<br>
+ std::error_code perform(std::unique_ptr<SimpleFile> &file) override {<br>
if (_ctx.getDebug())<br>
touch(_ctx.getPDBFilePath());<br>
+ return std::error_code();<br>
}<br>
<br>
private:<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>