Index: include/lld/Core/File.h =================================================================== --- include/lld/Core/File.h +++ include/lld/Core/File.h @@ -272,24 +272,6 @@ std::mutex _parseMutex; }; -/// \brief A mutable File. -class MutableFile : public File { -public: - /// \brief Add an atom to the file. Invalidates iterators for all returned - /// containters. - virtual void addAtom(const Atom&) = 0; - - typedef range::iterator> DefinedAtomRange; - virtual DefinedAtomRange definedAtoms() = 0; - - virtual void - removeDefinedAtomsIf(std::function pred) = 0; - -protected: - /// \brief only subclasses of MutableFile can be instantiated - MutableFile(StringRef p) : File(p, kindObject) {} -}; - /// An ErrorFile represents a file that doesn't exist. /// If you try to parse a file which doesn't exist, an instance of this /// class will be returned. That's parse method always returns an error. Index: include/lld/Core/Pass.h =================================================================== --- include/lld/Core/Pass.h +++ include/lld/Core/Pass.h @@ -17,7 +17,7 @@ #include namespace lld { -class MutableFile; +class SimpleFile; /// Once the core linking is done (which resolves references, coalesces atoms /// and produces a complete Atom graph), the linker runs a series of passes @@ -34,7 +34,7 @@ virtual ~Pass() { } /// Do the actual work of the Pass. - virtual void perform(std::unique_ptr &mergedFile) = 0; + virtual void perform(std::unique_ptr &mergedFile) = 0; protected: // Only subclassess can be instantiated. Index: include/lld/Core/PassManager.h =================================================================== --- include/lld/Core/PassManager.h +++ include/lld/Core/PassManager.h @@ -16,7 +16,7 @@ #include namespace lld { -class MutableFile; +class SimpleFile; class Pass; /// \brief Owns and runs a collection of passes. @@ -31,7 +31,7 @@ _passes.push_back(std::move(pass)); } - std::error_code runOnFile(std::unique_ptr &file) { + std::error_code runOnFile(std::unique_ptr &file) { for (std::unique_ptr &pass : _passes) pass->perform(file); return std::error_code(); Index: include/lld/Core/Resolver.h =================================================================== --- include/lld/Core/Resolver.h +++ include/lld/Core/Resolver.h @@ -54,7 +54,7 @@ /// @brief do work of merging and resolving and return list bool resolve(); - std::unique_ptr resultFile() { return std::move(_result); } + std::unique_ptr resultFile() { return std::move(_result); } private: typedef std::function UndefCallback; Index: include/lld/Core/Simple.h =================================================================== --- include/lld/Core/Simple.h +++ include/lld/Core/Simple.h @@ -26,11 +26,11 @@ namespace lld { -class SimpleFile : public MutableFile { +class SimpleFile : public File { public: - SimpleFile(StringRef path) : MutableFile(path) {} + SimpleFile(StringRef path) : File(path, kindObject) {} - void addAtom(const Atom &atom) override { + void addAtom(const Atom &atom) { if (auto *defAtom = dyn_cast(&atom)) { _definedAtoms._atoms.push_back(defAtom); } else if (auto *undefAtom = dyn_cast(&atom)) { @@ -44,8 +44,7 @@ } } - void - removeDefinedAtomsIf(std::function pred) override { + void removeDefinedAtomsIf(std::function pred) { auto &atoms = _definedAtoms._atoms; auto newEnd = std::remove_if(atoms.begin(), atoms.end(), pred); atoms.erase(newEnd, atoms.end()); @@ -67,9 +66,8 @@ return _absoluteAtoms; } - DefinedAtomRange definedAtoms() override { - return make_range(_definedAtoms._atoms); - } + typedef range::iterator> DefinedAtomRange; + DefinedAtomRange definedAtoms() { return make_range(_definedAtoms._atoms); } private: atom_collection_vector _definedAtoms; Index: lib/Driver/Driver.cpp =================================================================== --- lib/Driver/Driver.cpp +++ lib/Driver/Driver.cpp @@ -108,7 +108,7 @@ ctx.getTaskGroup().sync(); return false; } - std::unique_ptr merged = resolver.resultFile(); + std::unique_ptr merged = resolver.resultFile(); resolveTask.end(); // Run passes on linked atoms. Index: lib/ReaderWriter/CoreLinkingContext.cpp =================================================================== --- lib/ReaderWriter/CoreLinkingContext.cpp +++ lib/ReaderWriter/CoreLinkingContext.cpp @@ -144,8 +144,8 @@ class OrderPass : public Pass { public: /// Sorts atoms by position - void perform(std::unique_ptr &file) override { - MutableFile::DefinedAtomRange defined = file->definedAtoms(); + void perform(std::unique_ptr &file) override { + SimpleFile::DefinedAtomRange defined = file->definedAtoms(); std::sort(defined.begin(), defined.end(), DefinedAtom::compareByPosition); } }; Index: lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp =================================================================== --- lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp +++ lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp @@ -254,7 +254,7 @@ /// /// After all references are handled, the atoms created during that are all /// added to mf. - void perform(std::unique_ptr &mf) override { + void perform(std::unique_ptr &mf) override { ScopedTask task(getDefaultDomain(), "AArch64 GOT/PLT Pass"); DEBUG_WITH_TYPE( "AArch64", llvm::dbgs() << "Undefined Atoms" Index: lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp =================================================================== --- lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp +++ lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp @@ -482,7 +482,7 @@ /// /// After all references are handled, the atoms created during that are all /// added to mf. - void perform(std::unique_ptr &mf) override { + void perform(std::unique_ptr &mf) override { ScopedTask task(getDefaultDomain(), "ARM GOT/PLT Pass"); DEBUG_WITH_TYPE( "ARM", llvm::dbgs() << "Undefined Atoms" << "\n"; Index: lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp =================================================================== --- lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp +++ lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp @@ -171,7 +171,7 @@ /// /// After all references are handled, the atoms created during that are all /// added to mf. - void perform(std::unique_ptr &mf) override { + void perform(std::unique_ptr &mf) override { // Process all references. for (const auto &atom : mf->defined()) for (const auto &ref : *atom) Index: lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h =================================================================== --- lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h +++ lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h @@ -17,7 +17,7 @@ /// \brief This pass sorts atoms in .{ctors,dtors}. sections. class MipsCtorsOrderPass : public Pass { public: - void perform(std::unique_ptr &mergedFile) override; + void perform(std::unique_ptr &mergedFile) override; }; } } Index: lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp =================================================================== --- lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp +++ lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "MipsCtorsOrderPass.h" +#include "lld/Core/Simple.h" #include #include @@ -48,7 +49,7 @@ return priority; } -void MipsCtorsOrderPass::perform(std::unique_ptr &f) { +void MipsCtorsOrderPass::perform(std::unique_ptr &f) { auto definedAtoms = f->definedAtoms(); auto last = std::stable_partition(definedAtoms.begin(), definedAtoms.end(), Index: lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp =================================================================== --- lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp +++ lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp @@ -295,7 +295,7 @@ public: RelocationPass(MipsLinkingContext &ctx); - void perform(std::unique_ptr &mf) override; + void perform(std::unique_ptr &mf) override; private: /// \brief Reference to the linking context. @@ -418,7 +418,7 @@ } template -void RelocationPass::perform(std::unique_ptr &mf) { +void RelocationPass::perform(std::unique_ptr &mf) { for (const auto &atom : mf->defined()) for (const auto &ref : *atom) collectReferenceInfo(*cast>(atom), Index: lib/ReaderWriter/ELF/OrderPass.h =================================================================== --- lib/ReaderWriter/ELF/OrderPass.h +++ lib/ReaderWriter/ELF/OrderPass.h @@ -19,7 +19,7 @@ /// \brief This pass sorts atoms by file and atom ordinals. class OrderPass : public Pass { public: - void perform(std::unique_ptr &file) override { + void perform(std::unique_ptr &file) override { parallel_sort(file->definedAtoms().begin(), file->definedAtoms().end(), DefinedAtom::compareByPosition); } Index: lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp =================================================================== --- lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp +++ lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp @@ -253,7 +253,7 @@ /// /// After all references are handled, the atoms created during that are all /// added to mf. - void perform(std::unique_ptr &mf) override { + void perform(std::unique_ptr &mf) override { ScopedTask task(getDefaultDomain(), "X86-64 GOT/PLT Pass"); // Process all references. for (const auto &atom : mf->defined()) Index: lib/ReaderWriter/MachO/CompactUnwindPass.cpp =================================================================== --- lib/ReaderWriter/MachO/CompactUnwindPass.cpp +++ lib/ReaderWriter/MachO/CompactUnwindPass.cpp @@ -277,7 +277,7 @@ _isBig(MachOLinkingContext::isBigEndian(_context.arch())) {} private: - void perform(std::unique_ptr &mergedFile) override { + void perform(std::unique_ptr &mergedFile) override { DEBUG(llvm::dbgs() << "MachO Compact Unwind pass\n"); std::map unwindLocs; @@ -351,7 +351,7 @@ } void collectCompactUnwindEntries( - std::unique_ptr &mergedFile, + std::unique_ptr &mergedFile, std::map &unwindLocs, std::vector &personalities, uint32_t &numLSDAs) { DEBUG(llvm::dbgs() << " Collecting __compact_unwind entries\n"); @@ -422,7 +422,7 @@ } void - collectDwarfFrameEntries(std::unique_ptr &mergedFile, + collectDwarfFrameEntries(std::unique_ptr &mergedFile, std::map &dwarfFrames) { for (const DefinedAtom *ehFrameAtom : mergedFile->defined()) { if (ehFrameAtom->contentType() != DefinedAtom::typeCFI) @@ -442,7 +442,7 @@ /// + A synthesised reference to __eh_frame if there's no __compact_unwind /// or too many personality functions to be accommodated. std::vector createUnwindInfoEntries( - const std::unique_ptr &mergedFile, + const std::unique_ptr &mergedFile, const std::map &unwindLocs, const std::vector &personalities, const std::map &dwarfFrames) { Index: lib/ReaderWriter/MachO/GOTPass.cpp =================================================================== --- lib/ReaderWriter/MachO/GOTPass.cpp +++ lib/ReaderWriter/MachO/GOTPass.cpp @@ -96,8 +96,7 @@ _file("") { } private: - - void perform(std::unique_ptr &mergedFile) override { + void perform(std::unique_ptr &mergedFile) override { // Scan all references in all atoms. for (const DefinedAtom *atom : mergedFile->defined()) { for (const Reference *ref : *atom) { Index: lib/ReaderWriter/MachO/LayoutPass.h =================================================================== --- lib/ReaderWriter/MachO/LayoutPass.h +++ lib/ReaderWriter/MachO/LayoutPass.h @@ -13,6 +13,7 @@ #include "lld/Core/File.h" #include "lld/Core/Pass.h" #include "lld/Core/Reader.h" +#include "lld/Core/Simple.h" #include "llvm/ADT/DenseMap.h" #include #include @@ -20,7 +21,7 @@ namespace lld { class DefinedAtom; -class MutableFile; +class SimpleFile; namespace mach_o { @@ -45,17 +46,17 @@ LayoutPass(const Registry ®istry, SortOverride sorter); /// Sorts atoms in mergedFile by content type then by command line order. - void perform(std::unique_ptr &mergedFile) override; + void perform(std::unique_ptr &mergedFile) override; virtual ~LayoutPass() {} private: // Build the followOn atoms chain as specified by the kindLayoutAfter // reference type - void buildFollowOnTable(MutableFile::DefinedAtomRange &range); + void buildFollowOnTable(SimpleFile::DefinedAtomRange &range); // Build a map of Atoms to ordinals for sorting the atoms - void buildOrdinalOverrideMap(MutableFile::DefinedAtomRange &range); + void buildOrdinalOverrideMap(SimpleFile::DefinedAtomRange &range); const Registry &_registry; SortOverride _customSorter; @@ -83,12 +84,12 @@ void setChainRoot(const DefinedAtom *targetAtom, const DefinedAtom *root); - std::vector decorate(MutableFile::DefinedAtomRange &atomRange) const; - void undecorate(MutableFile::DefinedAtomRange &atomRange, + std::vector decorate(SimpleFile::DefinedAtomRange &atomRange) const; + void undecorate(SimpleFile::DefinedAtomRange &atomRange, std::vector &keys) const; // Check if the follow-on graph is a correct structure. For debugging only. - void checkFollowonChain(MutableFile::DefinedAtomRange &range); + void checkFollowonChain(SimpleFile::DefinedAtomRange &range); }; } // namespace mach_o Index: lib/ReaderWriter/MachO/LayoutPass.cpp =================================================================== --- lib/ReaderWriter/MachO/LayoutPass.cpp +++ lib/ReaderWriter/MachO/LayoutPass.cpp @@ -133,7 +133,7 @@ } } -static void printDefinedAtoms(const MutableFile::DefinedAtomRange &atomRange) { +static void printDefinedAtoms(const SimpleFile::DefinedAtomRange &atomRange) { for (const DefinedAtom *atom : atomRange) { llvm::dbgs() << " file=" << atom->file().path() << ", name=" << atom->name() @@ -146,7 +146,7 @@ /// Verify that the followon chain is sane. Should not be called in /// release binary. -void LayoutPass::checkFollowonChain(MutableFile::DefinedAtomRange &range) { +void LayoutPass::checkFollowonChain(SimpleFile::DefinedAtomRange &range) { ScopedTask task(getDefaultDomain(), "LayoutPass::checkFollowonChain"); // Verify that there's no cycle in follow-on chain. @@ -329,7 +329,7 @@ /// d) If the targetAtom is part of a different chain and the root of the /// targetAtom until the targetAtom has all atoms of size 0, then chain the /// targetAtoms and its tree to the current chain -void LayoutPass::buildFollowOnTable(MutableFile::DefinedAtomRange &range) { +void LayoutPass::buildFollowOnTable(SimpleFile::DefinedAtomRange &range) { ScopedTask task(getDefaultDomain(), "LayoutPass::buildFollowOnTable"); // Set the initial size of the followon and the followonNext hash to the // number of atoms that we have. @@ -397,7 +397,7 @@ /// assigning ordinals to each atom, if the atoms have their ordinals /// already assigned skip the atom and move to the next. This is the /// main map thats used to sort the atoms while comparing two atoms together -void LayoutPass::buildOrdinalOverrideMap(MutableFile::DefinedAtomRange &range) { +void LayoutPass::buildOrdinalOverrideMap(SimpleFile::DefinedAtomRange &range) { ScopedTask task(getDefaultDomain(), "LayoutPass::buildOrdinalOverrideMap"); uint64_t index = 0; for (const DefinedAtom *ai : range) { @@ -417,7 +417,7 @@ } std::vector -LayoutPass::decorate(MutableFile::DefinedAtomRange &atomRange) const { +LayoutPass::decorate(SimpleFile::DefinedAtomRange &atomRange) const { std::vector ret; for (const DefinedAtom *atom : atomRange) { auto ri = _followOnRoots.find(atom); @@ -429,7 +429,7 @@ return ret; } -void LayoutPass::undecorate(MutableFile::DefinedAtomRange &atomRange, +void LayoutPass::undecorate(SimpleFile::DefinedAtomRange &atomRange, std::vector &keys) const { size_t i = 0; for (SortKey &k : keys) @@ -437,10 +437,10 @@ } /// Perform the actual pass -void LayoutPass::perform(std::unique_ptr &mergedFile) { +void LayoutPass::perform(std::unique_ptr &mergedFile) { // sort the atoms ScopedTask task(getDefaultDomain(), "LayoutPass"); - MutableFile::DefinedAtomRange atomRange = mergedFile->definedAtoms(); + SimpleFile::DefinedAtomRange atomRange = mergedFile->definedAtoms(); // Build follow on tables buildFollowOnTable(atomRange); Index: lib/ReaderWriter/MachO/ShimPass.cpp =================================================================== --- lib/ReaderWriter/MachO/ShimPass.cpp +++ lib/ReaderWriter/MachO/ShimPass.cpp @@ -47,8 +47,7 @@ , _file("") { } - - void perform(std::unique_ptr &mergedFile) override { + void perform(std::unique_ptr &mergedFile) override { // Scan all references in all atoms. for (const DefinedAtom *atom : mergedFile->defined()) { for (const Reference *ref : *atom) { Index: lib/ReaderWriter/MachO/StubsPass.cpp =================================================================== --- lib/ReaderWriter/MachO/StubsPass.cpp +++ lib/ReaderWriter/MachO/StubsPass.cpp @@ -209,8 +209,7 @@ : _context(context), _archHandler(_context.archHandler()), _stubInfo(_archHandler.stubInfo()), _file("") { } - - void perform(std::unique_ptr &mergedFile) override { + void perform(std::unique_ptr &mergedFile) override { // Skip this pass if output format uses text relocations instead of stubs. if (!this->noTextRelocs()) return; Index: lib/ReaderWriter/PECOFF/EdataPass.h =================================================================== --- lib/ReaderWriter/PECOFF/EdataPass.h +++ lib/ReaderWriter/PECOFF/EdataPass.h @@ -66,7 +66,7 @@ EdataPass(PECOFFLinkingContext &ctx) : _ctx(ctx), _file(ctx), _is64(ctx.is64Bit()), _stringOrdinal(1024) {} - void perform(std::unique_ptr &file) override; + void perform(std::unique_ptr &file) override; private: edata::EdataAtom * @@ -80,7 +80,7 @@ edata::EdataAtom * createNamePointerTable(const PECOFFLinkingContext &ctx, const std::vector &entries, - MutableFile *file); + SimpleFile *file); edata::EdataAtom * createOrdinalTable(const std::vector &entries, Index: lib/ReaderWriter/PECOFF/EdataPass.cpp =================================================================== --- lib/ReaderWriter/PECOFF/EdataPass.cpp +++ lib/ReaderWriter/PECOFF/EdataPass.cpp @@ -78,7 +78,7 @@ desc.ordinal = nextOrdinal++; } -static bool getExportedAtoms(PECOFFLinkingContext &ctx, MutableFile *file, +static bool getExportedAtoms(PECOFFLinkingContext &ctx, SimpleFile *file, std::vector &ret) { std::map definedAtoms; for (const DefinedAtom *atom : file->defined()) @@ -135,7 +135,7 @@ edata::EdataAtom * EdataPass::createNamePointerTable(const PECOFFLinkingContext &ctx, const std::vector &entries, - MutableFile *file) { + SimpleFile *file) { EdataAtom *table = new (_alloc) EdataAtom(_file, sizeof(uint32_t) * entries.size()); @@ -175,7 +175,7 @@ return ret; } -void EdataPass::perform(std::unique_ptr &file) { +void EdataPass::perform(std::unique_ptr &file) { dedupExports(_ctx); assignOrdinals(_ctx); Index: lib/ReaderWriter/PECOFF/IdataPass.h =================================================================== --- lib/ReaderWriter/PECOFF/IdataPass.h +++ lib/ReaderWriter/PECOFF/IdataPass.h @@ -40,9 +40,9 @@ // A state object of this pass. struct IdataContext { - IdataContext(MutableFile &f, VirtualFile &g, const PECOFFLinkingContext &c) + IdataContext(SimpleFile &f, VirtualFile &g, const PECOFFLinkingContext &c) : file(f), dummyFile(g), ctx(c) {} - MutableFile &file; + SimpleFile &file; VirtualFile &dummyFile; const PECOFFLinkingContext &ctx; }; @@ -195,13 +195,13 @@ public: IdataPass(const PECOFFLinkingContext &ctx) : _dummyFile(ctx), _ctx(ctx) {} - void perform(std::unique_ptr &file) override; + void perform(std::unique_ptr &file) override; private: std::map> - groupByLoadName(MutableFile &file); + groupByLoadName(SimpleFile &file); - void replaceSharedLibraryAtoms(MutableFile &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 Index: lib/ReaderWriter/PECOFF/IdataPass.cpp =================================================================== --- lib/ReaderWriter/PECOFF/IdataPass.cpp +++ lib/ReaderWriter/PECOFF/IdataPass.cpp @@ -143,8 +143,8 @@ // Find "___delayLoadHelper2@8" (or "__delayLoadHelper2" on x64). // This is not efficient but should be OK for now. -static const Atom * -findDelayLoadHelper(MutableFile &file, const PECOFFLinkingContext &ctx) { +static const Atom *findDelayLoadHelper(SimpleFile &file, + const PECOFFLinkingContext &ctx) { StringRef sym = ctx.getDelayLoadHelperName(); for (const DefinedAtom *atom : file.defined()) if (atom->name() == sym) @@ -287,7 +287,7 @@ } // namespace idata -void IdataPass::perform(std::unique_ptr &file) { +void IdataPass::perform(std::unique_ptr &file) { if (file->sharedLibrary().empty()) return; @@ -324,8 +324,8 @@ replaceSharedLibraryAtoms(*file); } -std::map > -IdataPass::groupByLoadName(MutableFile &file) { +std::map> +IdataPass::groupByLoadName(SimpleFile &file) { std::map uniqueAtoms; for (const SharedLibraryAtom *atom : file.sharedLibrary()) uniqueAtoms[atom->name()] = @@ -340,7 +340,7 @@ } /// Transforms a reference to a COFFSharedLibraryAtom to a real reference. -void IdataPass::replaceSharedLibraryAtoms(MutableFile &file) { +void IdataPass::replaceSharedLibraryAtoms(SimpleFile &file) { for (const DefinedAtom *atom : file.defined()) { for (const Reference *ref : *atom) { const Atom *target = ref->target(); Index: lib/ReaderWriter/PECOFF/InferSubsystemPass.h =================================================================== --- lib/ReaderWriter/PECOFF/InferSubsystemPass.h +++ lib/ReaderWriter/PECOFF/InferSubsystemPass.h @@ -22,7 +22,7 @@ public: InferSubsystemPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {} - void perform(std::unique_ptr &file) override { + void perform(std::unique_ptr &file) override { if (_ctx.getSubsystem() != WindowsSubsystem::IMAGE_SUBSYSTEM_UNKNOWN) return; Index: lib/ReaderWriter/PECOFF/LoadConfigPass.h =================================================================== --- lib/ReaderWriter/PECOFF/LoadConfigPass.h +++ lib/ReaderWriter/PECOFF/LoadConfigPass.h @@ -49,7 +49,7 @@ public: LoadConfigPass(PECOFFLinkingContext &ctx) : _ctx(ctx), _file(ctx) {} - void perform(std::unique_ptr &file) override; + void perform(std::unique_ptr &file) override; private: PECOFFLinkingContext &_ctx; Index: lib/ReaderWriter/PECOFF/LoadConfigPass.cpp =================================================================== --- lib/ReaderWriter/PECOFF/LoadConfigPass.cpp +++ lib/ReaderWriter/PECOFF/LoadConfigPass.cpp @@ -49,7 +49,7 @@ } // namespace loadcfg -void LoadConfigPass::perform(std::unique_ptr &file) { +void LoadConfigPass::perform(std::unique_ptr &file) { if (_ctx.noSEH()) return; Index: lib/ReaderWriter/PECOFF/OrderPass.h =================================================================== --- lib/ReaderWriter/PECOFF/OrderPass.h +++ lib/ReaderWriter/PECOFF/OrderPass.h @@ -55,8 +55,8 @@ class OrderPass : public lld::Pass { public: - void perform(std::unique_ptr &file) override { - MutableFile::DefinedAtomRange defined = file->definedAtoms(); + void perform(std::unique_ptr &file) override { + SimpleFile::DefinedAtomRange defined = file->definedAtoms(); parallel_sort(defined.begin(), defined.end(), compare); } }; Index: lib/ReaderWriter/PECOFF/PDBPass.h =================================================================== --- lib/ReaderWriter/PECOFF/PDBPass.h +++ lib/ReaderWriter/PECOFF/PDBPass.h @@ -21,7 +21,7 @@ public: PDBPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {} - void perform(std::unique_ptr &file) override { + void perform(std::unique_ptr &file) override { if (_ctx.getDebug()) touch(_ctx.getPDBFilePath()); }