[lld] r240167 - Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&

David Blaikie dblaikie at gmail.com
Fri Jun 19 12:43:44 PDT 2015


Author: dblaikie
Date: Fri Jun 19 14:43:43 2015
New Revision: 240167

URL: http://llvm.org/viewvc/llvm-project?rev=240167&view=rev
Log:
Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&

None of the implementations replace the SimpleFile with some other file,
they just modify the SimpleFile in-place, so a direct reference to the
file is sufficient.

Modified:
    lld/trunk/include/lld/Core/Pass.h
    lld/trunk/include/lld/Core/PassManager.h
    lld/trunk/lib/Driver/Driver.cpp
    lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp
    lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
    lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
    lld/trunk/lib/ReaderWriter/ELF/OrderPass.h
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
    lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
    lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp
    lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp
    lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h
    lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp
    lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp
    lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp
    lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h
    lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp
    lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h
    lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h
    lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp
    lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h
    lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h
    lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h

Modified: lld/trunk/include/lld/Core/Pass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Pass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Pass.h (original)
+++ lld/trunk/include/lld/Core/Pass.h Fri Jun 19 14:43:43 2015
@@ -34,7 +34,7 @@ public:
   virtual ~Pass() { }
 
   /// Do the actual work of the Pass.
-  virtual std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) = 0;
+  virtual std::error_code perform(SimpleFile &mergedFile) = 0;
 
 protected:
   // Only subclassess can be instantiated.

Modified: lld/trunk/include/lld/Core/PassManager.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/PassManager.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/PassManager.h (original)
+++ lld/trunk/include/lld/Core/PassManager.h Fri Jun 19 14:43:43 2015
@@ -31,7 +31,7 @@ public:
     _passes.push_back(std::move(pass));
   }
 
-  std::error_code runOnFile(std::unique_ptr<SimpleFile> &file) {
+  std::error_code runOnFile(SimpleFile &file) {
     for (std::unique_ptr<Pass> &pass : _passes)
       if (std::error_code EC = pass->perform(file))
         return EC;

Modified: lld/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/Driver.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/Driver/Driver.cpp (original)
+++ lld/trunk/lib/Driver/Driver.cpp Fri Jun 19 14:43:43 2015
@@ -117,7 +117,7 @@ bool Driver::link(LinkingContext &ctx, r
   ScopedTask passTask(getDefaultDomain(), "Passes");
   PassManager pm;
   ctx.addPasses(pm);
-  if (std::error_code ec = pm.runOnFile(merged)) {
+  if (std::error_code ec = pm.runOnFile(*merged)) {
     diagnostics << "Failed to write file '" << ctx.outputPath()
                 << "': " << ec.message() << "\n";
     return false;

Modified: lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/CoreLinkingContext.cpp Fri Jun 19 14:43:43 2015
@@ -22,8 +22,8 @@ namespace {
 class OrderPass : public Pass {
 public:
   /// Sorts atoms by position
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override {
-    SimpleFile::DefinedAtomRange defined = file->definedAtoms();
+  std::error_code perform(SimpleFile &file) override {
+    SimpleFile::DefinedAtomRange defined = file.definedAtoms();
     std::sort(defined.begin(), defined.end(), DefinedAtom::compareByPosition);
     return std::error_code();
   }
@@ -40,10 +40,8 @@ bool CoreLinkingContext::validateImpl(ra
 
 void CoreLinkingContext::addPasses(PassManager &pm) {
   for (StringRef name : _passNames) {
-    if (name.equals("order"))
-      pm.add(std::unique_ptr<Pass>(new OrderPass()));
-    else
-      llvm_unreachable("bad pass name");
+    assert(name == "order" && "bad pass name");
+    pm.add(std::unique_ptr<Pass>(new OrderPass()));
   }
 }
 

Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp Fri Jun 19 14:43:43 2015
@@ -256,32 +256,32 @@ public:
   ///
   /// After all references are handled, the atoms created during that are all
   /// added to mf.
-  std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {
+  std::error_code perform(SimpleFile &mf) override {
     ScopedTask task(getDefaultDomain(), "AArch64 GOT/PLT Pass");
     DEBUG_WITH_TYPE(
         "AArch64", llvm::dbgs() << "Undefined Atoms"
                                 << "\n";
         for (const auto &atom
-             : mf->undefined()) {
+             : mf.undefined()) {
           llvm::dbgs() << " Name of Atom: " << atom->name().str() << "\n";
         } llvm::dbgs()
             << "Shared Library Atoms"
             << "\n";
         for (const auto &atom
-             : mf->sharedLibrary()) {
+             : mf.sharedLibrary()) {
           llvm::dbgs() << " Name of Atom: " << atom->name().str() << "\n";
         } llvm::dbgs()
             << "Absolute Atoms"
             << "\n";
         for (const auto &atom
-             : mf->absolute()) {
+             : mf.absolute()) {
           llvm::dbgs() << " Name of Atom: " << atom->name().str() << "\n";
         }
             // Process all references.
             llvm::dbgs()
             << "Defined Atoms"
             << "\n");
-    for (const auto &atom : mf->defined()) {
+    for (const auto &atom : mf.defined()) {
       for (const auto &ref : *atom) {
         handleReference(*atom, *ref);
       }
@@ -291,29 +291,29 @@ public:
     uint64_t ordinal = 0;
     if (_plt0) {
       _plt0->setOrdinal(ordinal++);
-      mf->addAtom(*_plt0);
+      mf.addAtom(*_plt0);
     }
     for (auto &plt : _pltVector) {
       plt->setOrdinal(ordinal++);
-      mf->addAtom(*plt);
+      mf.addAtom(*plt);
     }
     if (_null) {
       _null->setOrdinal(ordinal++);
-      mf->addAtom(*_null);
+      mf.addAtom(*_null);
     }
     if (_plt0) {
       _got0->setOrdinal(ordinal++);
       _got1->setOrdinal(ordinal++);
-      mf->addAtom(*_got0);
-      mf->addAtom(*_got1);
+      mf.addAtom(*_got0);
+      mf.addAtom(*_got1);
     }
     for (auto &got : _gotVector) {
       got->setOrdinal(ordinal++);
-      mf->addAtom(*got);
+      mf.addAtom(*got);
     }
     for (auto obj : _objectVector) {
       obj->setOrdinal(ordinal++);
-      mf->addAtom(*obj);
+      mf.addAtom(*obj);
     }
 
     return std::error_code();

Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp Fri Jun 19 14:43:43 2015
@@ -673,35 +673,35 @@ public:
   ///
   /// After all references are handled, the atoms created during that are all
   /// added to mf.
-  std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {
+  std::error_code perform(SimpleFile &mf) override {
     ScopedTask task(getDefaultDomain(), "ARM GOT/PLT Pass");
     DEBUG_WITH_TYPE(
         "ARM", llvm::dbgs() << "Undefined Atoms" << "\n";
         for (const auto &atom
-             : mf->undefined()) {
+             : mf.undefined()) {
           llvm::dbgs() << " Name of Atom: " << atom->name().str() << "\n";
         }
 
         llvm::dbgs() << "Shared Library Atoms" << "\n";
         for (const auto &atom
-             : mf->sharedLibrary()) {
+             : mf.sharedLibrary()) {
           llvm::dbgs() << " Name of Atom: " << atom->name().str() << "\n";
         }
 
         llvm::dbgs() << "Absolute Atoms" << "\n";
         for (const auto &atom
-             : mf->absolute()) {
+             : mf.absolute()) {
           llvm::dbgs() << " Name of Atom: " << atom->name().str() << "\n";
         }
 
         llvm::dbgs() << "Defined Atoms" << "\n";
         for (const auto &atom
-             : mf->defined()) {
+             : mf.defined()) {
           llvm::dbgs() << " Name of Atom: " << atom->name().str() << "\n";
         });
 
     // Process all references.
-    for (const auto &atom : mf->defined()) {
+    for (const auto &atom : mf.defined()) {
       for (const auto &ref : *atom) {
         handleReference(*atom, *ref);
       }
@@ -711,53 +711,53 @@ public:
     uint64_t ordinal = 0;
     if (_plt0) {
       _plt0->setOrdinal(ordinal++);
-      mf->addAtom(*_plt0);
+      mf.addAtom(*_plt0);
       _plt0_d->setOrdinal(ordinal++);
-      mf->addAtom(*_plt0_d);
+      mf.addAtom(*_plt0_d);
     }
     for (auto &pltKV : _pltAtoms) {
       auto &plt = pltKV.second;
       if (auto *v = plt._veneer) {
         v->setOrdinal(ordinal++);
-        mf->addAtom(*v);
+        mf.addAtom(*v);
       }
       auto *p = plt._plt;
       p->setOrdinal(ordinal++);
-      mf->addAtom(*p);
+      mf.addAtom(*p);
     }
     if (_null) {
       _null->setOrdinal(ordinal++);
-      mf->addAtom(*_null);
+      mf.addAtom(*_null);
     }
     if (_plt0) {
       _got0->setOrdinal(ordinal++);
-      mf->addAtom(*_got0);
+      mf.addAtom(*_got0);
       _got1->setOrdinal(ordinal++);
-      mf->addAtom(*_got1);
+      mf.addAtom(*_got1);
     }
     for (auto &gotKV : _gotAtoms) {
       auto &got = gotKV.second;
       got->setOrdinal(ordinal++);
-      mf->addAtom(*got);
+      mf.addAtom(*got);
     }
     for (auto &gotKV : _gotpltAtoms) {
       auto &got = gotKV.second;
       got->setOrdinal(ordinal++);
-      mf->addAtom(*got);
+      mf.addAtom(*got);
     }
     for (auto &objectKV : _objectAtoms) {
       auto &obj = objectKV.second;
       obj->setOrdinal(ordinal++);
-      mf->addAtom(*obj);
+      mf.addAtom(*obj);
     }
     for (auto &veneerKV : _veneerAtoms) {
       auto &veneer = veneerKV.second;
       auto *m = veneer._mapping;
       m->setOrdinal(ordinal++);
-      mf->addAtom(*m);
+      mf.addAtom(*m);
       auto *v = veneer._veneer;
       v->setOrdinal(ordinal++);
-      mf->addAtom(*v);
+      mf.addAtom(*v);
     }
 
     return std::error_code();

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Fri Jun 19 14:43:43 2015
@@ -169,9 +169,9 @@ public:
   ///
   /// After all references are handled, the atoms created during that are all
   /// added to mf.
-  std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {
+  std::error_code perform(SimpleFile &mf) override {
     // Process all references.
-    for (const auto &atom : mf->defined())
+    for (const auto &atom : mf.defined())
       for (const auto &ref : *atom)
         handleReference(*atom, *ref);
 
@@ -179,23 +179,23 @@ public:
     uint64_t ordinal = 0;
     if (_plt0) {
       _plt0->setOrdinal(ordinal++);
-      mf->addAtom(*_plt0);
+      mf.addAtom(*_plt0);
     }
     for (auto &plt : _pltVector) {
       plt->setOrdinal(ordinal++);
-      mf->addAtom(*plt);
+      mf.addAtom(*plt);
     }
     if (_null) {
       _null->setOrdinal(ordinal++);
-      mf->addAtom(*_null);
+      mf.addAtom(*_null);
     }
     if (_got0) {
       _got0->setOrdinal(ordinal++);
-      mf->addAtom(*_got0);
+      mf.addAtom(*_got0);
     }
     for (auto &got : _gotVector) {
       got->setOrdinal(ordinal++);
-      mf->addAtom(*got);
+      mf.addAtom(*got);
     }
 
     return std::error_code();

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp Fri Jun 19 14:43:43 2015
@@ -49,8 +49,8 @@ static int32_t getSectionPriority(String
   return priority;
 }
 
-std::error_code MipsCtorsOrderPass::perform(std::unique_ptr<SimpleFile> &f) {
-  auto definedAtoms = f->definedAtoms();
+std::error_code MipsCtorsOrderPass::perform(SimpleFile &f) {
+  auto definedAtoms = f.definedAtoms();
 
   auto last = std::stable_partition(definedAtoms.begin(), definedAtoms.end(),
                                     [](const DefinedAtom *atom) {

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h Fri Jun 19 14:43:43 2015
@@ -17,7 +17,7 @@ namespace elf {
 /// \brief This pass sorts atoms in .{ctors,dtors}.<priority> sections.
 class MipsCtorsOrderPass : public Pass {
 public:
-  std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override;
+  std::error_code perform(SimpleFile &mergedFile) override;
 };
 }
 }

Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Fri Jun 19 14:43:43 2015
@@ -302,7 +302,7 @@ template <typename ELFT> class Relocatio
 public:
   RelocationPass(MipsLinkingContext &ctx);
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &mf) override;
+  std::error_code perform(SimpleFile &mf) override;
 
 private:
   /// \brief Reference to the linking context.
@@ -428,14 +428,14 @@ RelocationPass<ELFT>::RelocationPass(Mip
 }
 
 template <typename ELFT>
-std::error_code RelocationPass<ELFT>::perform(std::unique_ptr<SimpleFile> &mf) {
-  for (const auto &atom : mf->defined())
+std::error_code RelocationPass<ELFT>::perform(SimpleFile &mf) {
+  for (const auto &atom : mf.defined())
     for (const auto &ref : *atom)
       collectReferenceInfo(*cast<MipsELFDefinedAtom<ELFT>>(atom),
                            const_cast<Reference &>(*ref));
 
   // Process all references.
-  for (const auto &atom : mf->defined())
+  for (const auto &atom : mf.defined())
     for (const auto &ref : *atom)
       handleReference(*cast<MipsELFDefinedAtom<ELFT>>(atom),
                       const_cast<Reference &>(*ref));
@@ -457,22 +457,22 @@ std::error_code RelocationPass<ELFT>::pe
       !_tlsGotVector.empty()) {
     SimpleDefinedAtom *ga = new (_file._alloc) MipsGlobalOffsetTableAtom(_file);
     ga->setOrdinal(ordinal++);
-    mf->addAtom(*ga);
+    mf.addAtom(*ga);
   }
 
   for (auto &got : _localGotVector) {
     got->setOrdinal(ordinal++);
-    mf->addAtom(*got);
+    mf.addAtom(*got);
   }
 
   for (auto &got : _globalGotVector) {
     got->setOrdinal(ordinal++);
-    mf->addAtom(*got);
+    mf.addAtom(*got);
   }
 
   for (auto &got : _tlsGotVector) {
     got->setOrdinal(ordinal++);
-    mf->addAtom(*got);
+    mf.addAtom(*got);
   }
 
   // Create and emit PLT0 entry.
@@ -484,19 +484,19 @@ std::error_code RelocationPass<ELFT>::pe
 
   if (plt0Atom) {
     plt0Atom->setOrdinal(ordinal++);
-    mf->addAtom(*plt0Atom);
+    mf.addAtom(*plt0Atom);
   }
 
   // Emit regular PLT entries firts.
   for (auto &plt : _pltRegVector) {
     plt->setOrdinal(ordinal++);
-    mf->addAtom(*plt);
+    mf.addAtom(*plt);
   }
 
   // microMIPS PLT entries come after regular ones.
   for (auto &plt : _pltMicroVector) {
     plt->setOrdinal(ordinal++);
-    mf->addAtom(*plt);
+    mf.addAtom(*plt);
   }
 
   // Assign PLT0 to GOTPLT entries.
@@ -506,17 +506,17 @@ std::error_code RelocationPass<ELFT>::pe
 
   for (auto &gotplt : _gotpltVector) {
     gotplt->setOrdinal(ordinal++);
-    mf->addAtom(*gotplt);
+    mf.addAtom(*gotplt);
   }
 
   for (auto obj : _objectVector) {
     obj->setOrdinal(ordinal++);
-    mf->addAtom(*obj);
+    mf.addAtom(*obj);
   }
 
   for (auto la25 : _la25Vector) {
     la25->setOrdinal(ordinal++);
-    mf->addAtom(*la25);
+    mf.addAtom(*la25);
   }
 
   return std::error_code();

Modified: lld/trunk/lib/ReaderWriter/ELF/OrderPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/OrderPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/OrderPass.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/OrderPass.h Fri Jun 19 14:43:43 2015
@@ -19,8 +19,8 @@ namespace elf {
 /// \brief This pass sorts atoms by file and atom ordinals.
 class OrderPass : public Pass {
 public:
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override {
-    parallel_sort(file->definedAtoms().begin(), file->definedAtoms().end(),
+  std::error_code perform(SimpleFile &file) override {
+    parallel_sort(file.definedAtoms().begin(), file.definedAtoms().end(),
                   DefinedAtom::compareByPosition);
     return std::error_code();
   }

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp Fri Jun 19 14:43:43 2015
@@ -254,10 +254,10 @@ public:
   ///
   /// After all references are handled, the atoms created during that are all
   /// added to mf.
-  std::error_code perform(std::unique_ptr<SimpleFile> &mf) override {
+  std::error_code perform(SimpleFile &mf) override {
     ScopedTask task(getDefaultDomain(), "X86-64 GOT/PLT Pass");
     // Process all references.
-    for (const auto &atom : mf->defined())
+    for (const auto &atom : mf.defined())
       for (const auto &ref : *atom)
         handleReference(*atom, *ref);
 
@@ -265,33 +265,33 @@ public:
     uint64_t ordinal = 0;
     if (_plt0) {
       _plt0->setOrdinal(ordinal++);
-      mf->addAtom(*_plt0);
+      mf.addAtom(*_plt0);
     }
     for (auto &plt : _pltVector) {
       plt->setOrdinal(ordinal++);
-      mf->addAtom(*plt);
+      mf.addAtom(*plt);
     }
     if (_null) {
       _null->setOrdinal(ordinal++);
-      mf->addAtom(*_null);
+      mf.addAtom(*_null);
     }
     if (_plt0) {
       _got0->setOrdinal(ordinal++);
       _got1->setOrdinal(ordinal++);
-      mf->addAtom(*_got0);
-      mf->addAtom(*_got1);
+      mf.addAtom(*_got0);
+      mf.addAtom(*_got1);
     }
     for (auto &got : _gotVector) {
       got->setOrdinal(ordinal++);
-      mf->addAtom(*got);
+      mf.addAtom(*got);
     }
     for (auto &got : _tlsGotVector) {
       got->setOrdinal(ordinal++);
-      mf->addAtom(*got);
+      mf.addAtom(*got);
     }
     for (auto obj : _objectVector) {
       obj->setOrdinal(ordinal++);
-      mf->addAtom(*obj);
+      mf.addAtom(*obj);
     }
     return std::error_code();
   }

Modified: lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp Fri Jun 19 14:43:43 2015
@@ -277,7 +277,7 @@ public:
         _isBig(MachOLinkingContext::isBigEndian(_ctx.arch())) {}
 
 private:
-  std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {
+  std::error_code perform(SimpleFile &mergedFile) override {
     DEBUG(llvm::dbgs() << "MachO Compact Unwind pass\n");
 
     std::map<const Atom *, CompactUnwindEntry> unwindLocs;
@@ -342,10 +342,10 @@ private:
     UnwindInfoAtom *unwind = new (_file.allocator())
         UnwindInfoAtom(_archHandler, _file, _isBig, personalities,
                        commonEncodings, pages, numLSDAs);
-    mergedFile->addAtom(*unwind);
+    mergedFile.addAtom(*unwind);
 
     // Finally, remove all __compact_unwind atoms now that we've processed them.
-    mergedFile->removeDefinedAtomsIf([](const DefinedAtom *atom) {
+    mergedFile.removeDefinedAtomsIf([](const DefinedAtom *atom) {
       return atom->contentType() == DefinedAtom::typeCompactUnwindInfo;
     });
 
@@ -353,12 +353,12 @@ private:
   }
 
   void collectCompactUnwindEntries(
-      std::unique_ptr<SimpleFile> &mergedFile,
+      const SimpleFile &mergedFile,
       std::map<const Atom *, CompactUnwindEntry> &unwindLocs,
       std::vector<const Atom *> &personalities, uint32_t &numLSDAs) {
     DEBUG(llvm::dbgs() << "  Collecting __compact_unwind entries\n");
 
-    for (const DefinedAtom *atom : mergedFile->defined()) {
+    for (const DefinedAtom *atom : mergedFile.defined()) {
       if (atom->contentType() != DefinedAtom::typeCompactUnwindInfo)
         continue;
 
@@ -424,9 +424,9 @@ private:
   }
 
   void
-  collectDwarfFrameEntries(std::unique_ptr<SimpleFile> &mergedFile,
+  collectDwarfFrameEntries(const SimpleFile &mergedFile,
                            std::map<const Atom *, const Atom *> &dwarfFrames) {
-    for (const DefinedAtom *ehFrameAtom : mergedFile->defined()) {
+    for (const DefinedAtom *ehFrameAtom : mergedFile.defined()) {
       if (ehFrameAtom->contentType() != DefinedAtom::typeCFI)
         continue;
       if (ArchHandler::isDwarfCIE(_isBig, ehFrameAtom))
@@ -444,7 +444,7 @@ private:
   ///   + A synthesised reference to __eh_frame if there's no __compact_unwind
   ///     or too many personality functions to be accommodated.
   std::vector<CompactUnwindEntry> createUnwindInfoEntries(
-      const std::unique_ptr<SimpleFile> &mergedFile,
+      const SimpleFile &mergedFile,
       const std::map<const Atom *, CompactUnwindEntry> &unwindLocs,
       const std::vector<const Atom *> &personalities,
       const std::map<const Atom *, const Atom *> &dwarfFrames) {
@@ -454,7 +454,7 @@ private:
     // The final order in the __unwind_info section must be derived from the
     // order of typeCode atoms, since that's how they'll be put into the object
     // file eventually (yuck!).
-    for (const DefinedAtom *atom : mergedFile->defined()) {
+    for (const DefinedAtom *atom : mergedFile.defined()) {
       if (atom->contentType() != DefinedAtom::typeCode)
         continue;
 

Modified: lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp Fri Jun 19 14:43:43 2015
@@ -96,9 +96,9 @@ public:
         _file("<mach-o GOT Pass>") {}
 
 private:
-  std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {
+  std::error_code perform(SimpleFile &mergedFile) override {
     // Scan all references in all atoms.
-    for (const DefinedAtom *atom : mergedFile->defined()) {
+    for (const DefinedAtom *atom : mergedFile.defined()) {
       for (const Reference *ref : *atom) {
         // Look at instructions accessing the GOT.
         bool canBypassGOT;
@@ -130,7 +130,7 @@ private:
       return (left->slotName().compare(right->slotName()) < 0);
     });
     for (const GOTEntryAtom *slot : entries)
-      mergedFile->addAtom(*slot);
+      mergedFile.addAtom(*slot);
 
     return std::error_code();
   }

Modified: lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp Fri Jun 19 14:43:43 2015
@@ -437,10 +437,10 @@ void LayoutPass::undecorate(SimpleFile::
 }
 
 /// Perform the actual pass
-std::error_code LayoutPass::perform(std::unique_ptr<SimpleFile> &mergedFile) {
+std::error_code LayoutPass::perform(SimpleFile &mergedFile) {
   // sort the atoms
   ScopedTask task(getDefaultDomain(), "LayoutPass");
-  SimpleFile::DefinedAtomRange atomRange = mergedFile->definedAtoms();
+  SimpleFile::DefinedAtomRange atomRange = mergedFile.definedAtoms();
 
   // Build follow on tables
   buildFollowOnTable(atomRange);

Modified: lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h (original)
+++ lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h Fri Jun 19 14:43:43 2015
@@ -46,7 +46,7 @@ public:
   LayoutPass(const Registry &registry, SortOverride sorter);
 
   /// Sorts atoms in mergedFile by content type then by command line order.
-  std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override;
+  std::error_code perform(SimpleFile &mergedFile) override;
 
   virtual ~LayoutPass() {}
 

Modified: lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp Fri Jun 19 14:43:43 2015
@@ -44,9 +44,9 @@ public:
       : _ctx(context), _archHandler(_ctx.archHandler()),
         _stubInfo(_archHandler.stubInfo()), _file("<mach-o shim pass>") {}
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {
+  std::error_code perform(SimpleFile &mergedFile) override {
     // Scan all references in all atoms.
-    for (const DefinedAtom *atom : mergedFile->defined()) {
+    for (const DefinedAtom *atom : mergedFile.defined()) {
       for (const Reference *ref : *atom) {
         // Look at non-call branches.
         if (!_archHandler.isNonCallBranch(*ref))
@@ -77,9 +77,8 @@ public:
               });
 
     // Add all shims to master file.
-    for (const DefinedAtom *shim : shims) {
-      mergedFile->addAtom(*shim);
-    }
+    for (const DefinedAtom *shim : shims)
+      mergedFile.addAtom(*shim);
 
     return std::error_code();
   }

Modified: lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp Fri Jun 19 14:43:43 2015
@@ -209,13 +209,13 @@ public:
       : _ctx(context), _archHandler(_ctx.archHandler()),
         _stubInfo(_archHandler.stubInfo()), _file("<mach-o Stubs pass>") {}
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override {
+  std::error_code perform(SimpleFile &mergedFile) override {
     // Skip this pass if output format uses text relocations instead of stubs.
     if (!this->noTextRelocs())
       return std::error_code();
 
     // Scan all references in all atoms.
-    for (const DefinedAtom *atom : mergedFile->defined()) {
+    for (const DefinedAtom *atom : mergedFile.defined()) {
       for (const Reference *ref : *atom) {
         // Look at call-sites.
         if (!this->isCallSite(*ref))
@@ -258,17 +258,18 @@ public:
     addOptReference(
         helperCommonAtom, _stubInfo.stubHelperCommonReferenceToBinder,
         _stubInfo.optStubHelperCommonReferenceToBinder, helperBinderNLPAtom);
-    mergedFile->addAtom(*helperCommonAtom);
-    mergedFile->addAtom(*helperBinderNLPAtom);
-    mergedFile->addAtom(*helperCacheNLPAtom);
+    mergedFile.addAtom(*helperCommonAtom);
+    mergedFile.addAtom(*helperBinderNLPAtom);
+    mergedFile.addAtom(*helperCacheNLPAtom);
 
     // Add reference to dyld_stub_binder in libSystem.dylib
     auto I = std::find_if(
-        mergedFile->sharedLibrary().begin(), mergedFile->sharedLibrary().end(),
+        mergedFile.sharedLibrary().begin(), mergedFile.sharedLibrary().end(),
         [&](const SharedLibraryAtom *atom) {
           return atom->name().equals(_stubInfo.binderSymbolName);
         });
-    assert(I != mergedFile->sharedLibrary().end() && "dyld_stub_binder not found");
+    assert(I != mergedFile.sharedLibrary().end() &&
+           "dyld_stub_binder not found");
     addReference(helperBinderNLPAtom, _stubInfo.nonLazyPointerReferenceToBinder, *I);
 
     // Sort targets by name, so stubs and lazy pointers are consistent
@@ -300,9 +301,9 @@ public:
       addReference(helper, _stubInfo.stubHelperReferenceToHelperCommon,
                    helperCommonAtom);
 
-      mergedFile->addAtom(*stub);
-      mergedFile->addAtom(*lp);
-      mergedFile->addAtom(*helper);
+      mergedFile.addAtom(*stub);
+      mergedFile.addAtom(*lp);
+      mergedFile.addAtom(*helper);
 
       // Update each reference to use stub.
       for (const Reference *ref : _targetToUses[target]) {

Modified: lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.cpp Fri Jun 19 14:43:43 2015
@@ -78,10 +78,10 @@ static void assignOrdinals(PECOFFLinking
       desc.ordinal = nextOrdinal++;
 }
 
-static bool getExportedAtoms(PECOFFLinkingContext &ctx, SimpleFile *file,
+static bool getExportedAtoms(PECOFFLinkingContext &ctx, const SimpleFile &file,
                              std::vector<TableEntry> &ret) {
   std::map<StringRef, const DefinedAtom *> definedAtoms;
-  for (const DefinedAtom *atom : file->defined())
+  for (const DefinedAtom *atom : file.defined())
     definedAtoms[atom->name()] = atom;
 
   for (PECOFFLinkingContext::ExportDesc &desc : ctx.getDllExports()) {
@@ -175,12 +175,12 @@ EdataPass::createOrdinalTable(const std:
   return ret;
 }
 
-std::error_code EdataPass::perform(std::unique_ptr<SimpleFile> &file) {
+std::error_code EdataPass::perform(SimpleFile &file) {
   dedupExports(_ctx);
   assignOrdinals(_ctx);
 
   std::vector<TableEntry> entries;
-  if (!getExportedAtoms(_ctx, file.get(), entries))
+  if (!getExportedAtoms(_ctx, file, entries))
     return std::error_code();
   if (entries.empty())
     return std::error_code();
@@ -195,30 +195,30 @@ std::error_code EdataPass::perform(std::
 
   EdataAtom *table =
       createExportDirectoryTable(namedEntries, ordinalBase, maxOrdinal);
-  file->addAtom(*table);
+  file.addAtom(*table);
 
   COFFStringAtom *dllName =
       new (_alloc) COFFStringAtom(_file, _stringOrdinal++, ".edata",
                                   llvm::sys::path::filename(_ctx.outputPath()));
-  file->addAtom(*dllName);
+  file.addAtom(*dllName);
   addDir32NBReloc(table, dllName, _ctx.getMachineType(),
                   offsetof(export_directory_table_entry, NameRVA));
 
   EdataAtom *addressTable =
       createAddressTable(entries, ordinalBase, maxOrdinal);
-  file->addAtom(*addressTable);
+  file.addAtom(*addressTable);
   addDir32NBReloc(
       table, addressTable, _ctx.getMachineType(),
       offsetof(export_directory_table_entry, ExportAddressTableRVA));
 
   EdataAtom *namePointerTable =
-      createNamePointerTable(_ctx, namedEntries, file.get());
-  file->addAtom(*namePointerTable);
+      createNamePointerTable(_ctx, namedEntries, &file);
+  file.addAtom(*namePointerTable);
   addDir32NBReloc(table, namePointerTable, _ctx.getMachineType(),
                   offsetof(export_directory_table_entry, NamePointerRVA));
 
   EdataAtom *ordinalTable = createOrdinalTable(namedEntries, ordinalBase);
-  file->addAtom(*ordinalTable);
+  file.addAtom(*ordinalTable);
   addDir32NBReloc(table, ordinalTable, _ctx.getMachineType(),
                   offsetof(export_directory_table_entry, OrdinalTableRVA));
 

Modified: lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/EdataPass.h Fri Jun 19 14:43:43 2015
@@ -66,7 +66,7 @@ public:
   EdataPass(PECOFFLinkingContext &ctx)
       : _ctx(ctx), _file(ctx), _is64(ctx.is64Bit()), _stringOrdinal(1024) {}
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override;
+  std::error_code perform(SimpleFile &file) override;
 
 private:
   edata::EdataAtom *

Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.cpp Fri Jun 19 14:43:43 2015
@@ -287,13 +287,13 @@ DelayLoaderAtom::createContent(MachineTy
 
 } // namespace idata
 
-std::error_code IdataPass::perform(std::unique_ptr<SimpleFile> &file) {
-  if (file->sharedLibrary().empty())
+std::error_code IdataPass::perform(SimpleFile &file) {
+  if (file.sharedLibrary().empty())
     return std::error_code();
 
-  idata::IdataContext context(*file, _dummyFile, _ctx);
+  idata::IdataContext context(file, _dummyFile, _ctx);
   std::map<StringRef, std::vector<COFFSharedLibraryAtom *>> sharedAtoms =
-      groupByLoadName(*file);
+      groupByLoadName(file);
   bool hasImports = false;
   bool hasDelayImports = false;
 
@@ -321,7 +321,7 @@ std::error_code IdataPass::perform(std::
   if (hasDelayImports)
     new (_alloc) idata::DelayNullImportDirectoryAtom(context);
 
-  replaceSharedLibraryAtoms(*file);
+  replaceSharedLibraryAtoms(&file);
 
   return std::error_code();
 }
@@ -342,8 +342,8 @@ IdataPass::groupByLoadName(SimpleFile &f
 }
 
 /// Transforms a reference to a COFFSharedLibraryAtom to a real reference.
-void IdataPass::replaceSharedLibraryAtoms(SimpleFile &file) {
-  for (const DefinedAtom *atom : file.defined()) {
+void IdataPass::replaceSharedLibraryAtoms(SimpleFile *file) {
+  for (const DefinedAtom *atom : file->defined()) {
     for (const Reference *ref : *atom) {
       const Atom *target = ref->target();
       auto *sharedAtom = dyn_cast<SharedLibraryAtom>(target);

Modified: lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/IdataPass.h Fri Jun 19 14:43:43 2015
@@ -195,13 +195,13 @@ class IdataPass : public lld::Pass {
 public:
   IdataPass(const PECOFFLinkingContext &ctx) : _dummyFile(ctx), _ctx(ctx) {}
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override;
+  std::error_code perform(SimpleFile &file) override;
 
 private:
   std::map<StringRef, std::vector<COFFSharedLibraryAtom *>>
   groupByLoadName(SimpleFile &file);
 
-  void replaceSharedLibraryAtoms(SimpleFile &file);
+  void replaceSharedLibraryAtoms(SimpleFile *file);
 
   // A dummy file with which all the atoms created in the pass will be
   // associated. Atoms need to be associated to an input file even if it's not

Modified: lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/InferSubsystemPass.h Fri Jun 19 14:43:43 2015
@@ -22,7 +22,7 @@ class InferSubsystemPass : public lld::P
 public:
   InferSubsystemPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {}
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override {
+  std::error_code perform(SimpleFile &file) override {
     if (_ctx.getSubsystem() != WindowsSubsystem::IMAGE_SUBSYSTEM_UNKNOWN)
       return std::error_code();
 
@@ -41,7 +41,7 @@ public:
     const std::string main = _ctx.decorateSymbol("mainCRTStartup");
     const std::string mainAt = _ctx.decorateSymbol("mainCRTStartup@");
 
-    for (const DefinedAtom *atom : file->definedAtoms()) {
+    for (const DefinedAtom *atom : file.definedAtoms()) {
       if (atom->name() == wWinMain || atom->name().startswith(wWinMainAt) ||
           atom->name() == winMain || atom->name().startswith(winMainAt)) {
         _ctx.setSubsystem(WindowsSubsystem::IMAGE_SUBSYSTEM_WINDOWS_GUI);

Modified: lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp Fri Jun 19 14:43:43 2015
@@ -49,14 +49,14 @@ LoadConfigAtom::LoadConfigAtom(VirtualFi
 
 } // namespace loadcfg
 
-std::error_code LoadConfigPass::perform(std::unique_ptr<SimpleFile> &file) {
+std::error_code LoadConfigPass::perform(SimpleFile &file) {
   if (_ctx.noSEH())
     return std::error_code();
 
   // Find the first atom in .sxdata section.
   const DefinedAtom *sxdata = nullptr;
   int sectionSize = 0;
-  for (const DefinedAtom *atom : file->defined()) {
+  for (const DefinedAtom *atom : file.defined()) {
     if (atom->customSectionName() == ".sxdata") {
       if (!sxdata)
         sxdata = atom;
@@ -68,7 +68,7 @@ std::error_code LoadConfigPass::perform(
 
   auto *loadcfg = new (_alloc)
       loadcfg::LoadConfigAtom(_file, sxdata, sectionSize / sizeof(uint32_t));
-  file->addAtom(*loadcfg);
+  file.addAtom(*loadcfg);
 
   return std::error_code();
 }

Modified: lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/LoadConfigPass.h Fri Jun 19 14:43:43 2015
@@ -49,7 +49,7 @@ class LoadConfigPass : public lld::Pass
 public:
   LoadConfigPass(PECOFFLinkingContext &ctx) : _ctx(ctx), _file(ctx) {}
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override;
+  std::error_code perform(SimpleFile &file) override;
 
 private:
   PECOFFLinkingContext &_ctx;

Modified: lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/OrderPass.h Fri Jun 19 14:43:43 2015
@@ -55,8 +55,8 @@ static bool compare(const DefinedAtom *l
 
 class OrderPass : public lld::Pass {
 public:
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override {
-    SimpleFile::DefinedAtomRange defined = file->definedAtoms();
+  std::error_code perform(SimpleFile &file) override {
+    SimpleFile::DefinedAtomRange defined = file.definedAtoms();
     parallel_sort(defined.begin(), defined.end(), compare);
     return std::error_code();
   }

Modified: lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h?rev=240167&r1=240166&r2=240167&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/PDBPass.h Fri Jun 19 14:43:43 2015
@@ -21,7 +21,7 @@ class PDBPass : public lld::Pass {
 public:
   PDBPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {}
 
-  std::error_code perform(std::unique_ptr<SimpleFile> &file) override {
+  std::error_code perform(SimpleFile &) override {
     if (_ctx.getDebug())
       touch(_ctx.getPDBFilePath());
     return std::error_code();





More information about the llvm-commits mailing list