summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-04-07 20:43:38 +0000
committerRui Ueyama <ruiu@google.com>2015-04-07 20:43:38 +0000
commit3c45cffd68cd9839d4737ea260ed2706ab304cc9 (patch)
treea9e98d63c888ff305a2683d6120ba195ccbed629 /lld/lib/ReaderWriter
parent6bea2f4f88ddc4437c4a072ca60118e7ad8ed834 (diff)
downloadbcm5719-llvm-3c45cffd68cd9839d4737ea260ed2706ab304cc9.tar.gz
bcm5719-llvm-3c45cffd68cd9839d4737ea260ed2706ab304cc9.zip
Merge MutableFile with SimpleFile.
SimpleFile is the only derived class of MutableFile. This patch reduces the height of class hierarchy by removing MutableFile class. llvm-svn: 234354
Diffstat (limited to 'lld/lib/ReaderWriter')
-rw-r--r--lld/lib/ReaderWriter/CoreLinkingContext.cpp4
-rw-r--r--lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp2
-rw-r--r--lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp2
-rw-r--r--lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp2
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp3
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h2
-rw-r--r--lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp4
-rw-r--r--lld/lib/ReaderWriter/ELF/OrderPass.h2
-rw-r--r--lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp2
-rw-r--r--lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp8
-rw-r--r--lld/lib/ReaderWriter/MachO/GOTPass.cpp3
-rw-r--r--lld/lib/ReaderWriter/MachO/LayoutPass.cpp16
-rw-r--r--lld/lib/ReaderWriter/MachO/LayoutPass.h15
-rw-r--r--lld/lib/ReaderWriter/MachO/ShimPass.cpp3
-rw-r--r--lld/lib/ReaderWriter/MachO/StubsPass.cpp3
-rw-r--r--lld/lib/ReaderWriter/PECOFF/EdataPass.cpp6
-rw-r--r--lld/lib/ReaderWriter/PECOFF/EdataPass.h4
-rw-r--r--lld/lib/ReaderWriter/PECOFF/IdataPass.cpp12
-rw-r--r--lld/lib/ReaderWriter/PECOFF/IdataPass.h10
-rw-r--r--lld/lib/ReaderWriter/PECOFF/InferSubsystemPass.h2
-rw-r--r--lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp2
-rw-r--r--lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h2
-rw-r--r--lld/lib/ReaderWriter/PECOFF/OrderPass.h4
-rw-r--r--lld/lib/ReaderWriter/PECOFF/PDBPass.h2
24 files changed, 57 insertions, 58 deletions
diff --git a/lld/lib/ReaderWriter/CoreLinkingContext.cpp b/lld/lib/ReaderWriter/CoreLinkingContext.cpp
index 316f858844a..1c4013304c0 100644
--- a/lld/lib/ReaderWriter/CoreLinkingContext.cpp
+++ b/lld/lib/ReaderWriter/CoreLinkingContext.cpp
@@ -144,8 +144,8 @@ private:
class OrderPass : public Pass {
public:
/// Sorts atoms by position
- void perform(std::unique_ptr<MutableFile> &file) override {
- MutableFile::DefinedAtomRange defined = file->definedAtoms();
+ void perform(std::unique_ptr<SimpleFile> &file) override {
+ SimpleFile::DefinedAtomRange defined = file->definedAtoms();
std::sort(defined.begin(), defined.end(), DefinedAtom::compareByPosition);
}
};
diff --git a/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp b/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
index 2f0735f2ac7..ba74bd597fc 100644
--- a/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
+++ b/lld/lib/ReaderWriter/ELF/AArch64/AArch64RelocationPass.cpp
@@ -254,7 +254,7 @@ public:
///
/// After all references are handled, the atoms created during that are all
/// added to mf.
- void perform(std::unique_ptr<MutableFile> &mf) override {
+ void perform(std::unique_ptr<SimpleFile> &mf) override {
ScopedTask task(getDefaultDomain(), "AArch64 GOT/PLT Pass");
DEBUG_WITH_TYPE(
"AArch64", llvm::dbgs() << "Undefined Atoms"
diff --git a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
index 22bcb4d4e0a..9889f1fc33c 100644
--- a/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
+++ b/lld/lib/ReaderWriter/ELF/ARM/ARMRelocationPass.cpp
@@ -482,7 +482,7 @@ public:
///
/// After all references are handled, the atoms created during that are all
/// added to mf.
- void perform(std::unique_ptr<MutableFile> &mf) override {
+ void perform(std::unique_ptr<SimpleFile> &mf) override {
ScopedTask task(getDefaultDomain(), "ARM GOT/PLT Pass");
DEBUG_WITH_TYPE(
"ARM", llvm::dbgs() << "Undefined Atoms" << "\n";
diff --git a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
index 85a2d4fe268..b69bc946e5f 100644
--- a/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
+++ b/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
@@ -171,7 +171,7 @@ public:
///
/// After all references are handled, the atoms created during that are all
/// added to mf.
- void perform(std::unique_ptr<MutableFile> &mf) override {
+ void perform(std::unique_ptr<SimpleFile> &mf) override {
// Process all references.
for (const auto &atom : mf->defined())
for (const auto &ref : *atom)
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp
index 8bf80257fc8..4383ad4a783 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "MipsCtorsOrderPass.h"
+#include "lld/Core/Simple.h"
#include <algorithm>
#include <climits>
@@ -48,7 +49,7 @@ static int32_t getSectionPriority(StringRef path, StringRef sectionName) {
return priority;
}
-void MipsCtorsOrderPass::perform(std::unique_ptr<MutableFile> &f) {
+void MipsCtorsOrderPass::perform(std::unique_ptr<SimpleFile> &f) {
auto definedAtoms = f->definedAtoms();
auto last = std::stable_partition(definedAtoms.begin(), definedAtoms.end(),
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h b/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h
index eeb1a194f9c..733e2d4d256 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsCtorsOrderPass.h
@@ -17,7 +17,7 @@ namespace elf {
/// \brief This pass sorts atoms in .{ctors,dtors}.<priority> sections.
class MipsCtorsOrderPass : public Pass {
public:
- void perform(std::unique_ptr<MutableFile> &mergedFile) override;
+ void perform(std::unique_ptr<SimpleFile> &mergedFile) override;
};
}
}
diff --git a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
index 1788e634015..203957a92db 100644
--- a/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
+++ b/lld/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
@@ -295,7 +295,7 @@ template <typename ELFT> class RelocationPass : public Pass {
public:
RelocationPass(MipsLinkingContext &ctx);
- void perform(std::unique_ptr<MutableFile> &mf) override;
+ void perform(std::unique_ptr<SimpleFile> &mf) override;
private:
/// \brief Reference to the linking context.
@@ -418,7 +418,7 @@ RelocationPass<ELFT>::RelocationPass(MipsLinkingContext &ctx)
}
template <typename ELFT>
-void RelocationPass<ELFT>::perform(std::unique_ptr<MutableFile> &mf) {
+void RelocationPass<ELFT>::perform(std::unique_ptr<SimpleFile> &mf) {
for (const auto &atom : mf->defined())
for (const auto &ref : *atom)
collectReferenceInfo(*cast<MipsELFDefinedAtom<ELFT>>(atom),
diff --git a/lld/lib/ReaderWriter/ELF/OrderPass.h b/lld/lib/ReaderWriter/ELF/OrderPass.h
index d126b830db9..74bddc8acb4 100644
--- a/lld/lib/ReaderWriter/ELF/OrderPass.h
+++ b/lld/lib/ReaderWriter/ELF/OrderPass.h
@@ -19,7 +19,7 @@ namespace elf {
/// \brief This pass sorts atoms by file and atom ordinals.
class OrderPass : public Pass {
public:
- void perform(std::unique_ptr<MutableFile> &file) override {
+ void perform(std::unique_ptr<SimpleFile> &file) override {
parallel_sort(file->definedAtoms().begin(), file->definedAtoms().end(),
DefinedAtom::compareByPosition);
}
diff --git a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
index 0395c523a1a..64d46f912d5 100644
--- a/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
+++ b/lld/lib/ReaderWriter/ELF/X86_64/X86_64RelocationPass.cpp
@@ -253,7 +253,7 @@ public:
///
/// After all references are handled, the atoms created during that are all
/// added to mf.
- void perform(std::unique_ptr<MutableFile> &mf) override {
+ void perform(std::unique_ptr<SimpleFile> &mf) override {
ScopedTask task(getDefaultDomain(), "X86-64 GOT/PLT Pass");
// Process all references.
for (const auto &atom : mf->defined())
diff --git a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
index e2037c354bc..3bef510ced8 100644
--- a/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
@@ -277,7 +277,7 @@ public:
_isBig(MachOLinkingContext::isBigEndian(_context.arch())) {}
private:
- void perform(std::unique_ptr<MutableFile> &mergedFile) override {
+ void perform(std::unique_ptr<SimpleFile> &mergedFile) override {
DEBUG(llvm::dbgs() << "MachO Compact Unwind pass\n");
std::map<const Atom *, CompactUnwindEntry> unwindLocs;
@@ -351,7 +351,7 @@ private:
}
void collectCompactUnwindEntries(
- std::unique_ptr<MutableFile> &mergedFile,
+ std::unique_ptr<SimpleFile> &mergedFile,
std::map<const Atom *, CompactUnwindEntry> &unwindLocs,
std::vector<const Atom *> &personalities, uint32_t &numLSDAs) {
DEBUG(llvm::dbgs() << " Collecting __compact_unwind entries\n");
@@ -422,7 +422,7 @@ private:
}
void
- collectDwarfFrameEntries(std::unique_ptr<MutableFile> &mergedFile,
+ collectDwarfFrameEntries(std::unique_ptr<SimpleFile> &mergedFile,
std::map<const Atom *, const Atom *> &dwarfFrames) {
for (const DefinedAtom *ehFrameAtom : mergedFile->defined()) {
if (ehFrameAtom->contentType() != DefinedAtom::typeCFI)
@@ -442,7 +442,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<MutableFile> &mergedFile,
+ const std::unique_ptr<SimpleFile> &mergedFile,
const std::map<const Atom *, CompactUnwindEntry> &unwindLocs,
const std::vector<const Atom *> &personalities,
const std::map<const Atom *, const Atom *> &dwarfFrames) {
diff --git a/lld/lib/ReaderWriter/MachO/GOTPass.cpp b/lld/lib/ReaderWriter/MachO/GOTPass.cpp
index 7dc7f0b9412..5e885c2c620 100644
--- a/lld/lib/ReaderWriter/MachO/GOTPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/GOTPass.cpp
@@ -96,8 +96,7 @@ public:
_file("<mach-o GOT Pass>") { }
private:
-
- void perform(std::unique_ptr<MutableFile> &mergedFile) override {
+ void perform(std::unique_ptr<SimpleFile> &mergedFile) override {
// Scan all references in all atoms.
for (const DefinedAtom *atom : mergedFile->defined()) {
for (const Reference *ref : *atom) {
diff --git a/lld/lib/ReaderWriter/MachO/LayoutPass.cpp b/lld/lib/ReaderWriter/MachO/LayoutPass.cpp
index 2d096e4c1a6..de3d5c21db1 100644
--- a/lld/lib/ReaderWriter/MachO/LayoutPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/LayoutPass.cpp
@@ -133,7 +133,7 @@ static void checkReachabilityFromRoot(AtomToAtomT &followOnRoots,
}
}
-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 @@ static void printDefinedAtoms(const MutableFile::DefinedAtomRange &atomRange) {
/// 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 @@ void LayoutPass::setChainRoot(const DefinedAtom *targetAtom,
/// 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 @@ void LayoutPass::buildFollowOnTable(MutableFile::DefinedAtomRange &range) {
/// 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 @@ void LayoutPass::buildOrdinalOverrideMap(MutableFile::DefinedAtomRange &range) {
}
std::vector<LayoutPass::SortKey>
-LayoutPass::decorate(MutableFile::DefinedAtomRange &atomRange) const {
+LayoutPass::decorate(SimpleFile::DefinedAtomRange &atomRange) const {
std::vector<SortKey> ret;
for (const DefinedAtom *atom : atomRange) {
auto ri = _followOnRoots.find(atom);
@@ -429,7 +429,7 @@ LayoutPass::decorate(MutableFile::DefinedAtomRange &atomRange) const {
return ret;
}
-void LayoutPass::undecorate(MutableFile::DefinedAtomRange &atomRange,
+void LayoutPass::undecorate(SimpleFile::DefinedAtomRange &atomRange,
std::vector<SortKey> &keys) const {
size_t i = 0;
for (SortKey &k : keys)
@@ -437,10 +437,10 @@ void LayoutPass::undecorate(MutableFile::DefinedAtomRange &atomRange,
}
/// Perform the actual pass
-void LayoutPass::perform(std::unique_ptr<MutableFile> &mergedFile) {
+void LayoutPass::perform(std::unique_ptr<SimpleFile> &mergedFile) {
// sort the atoms
ScopedTask task(getDefaultDomain(), "LayoutPass");
- MutableFile::DefinedAtomRange atomRange = mergedFile->definedAtoms();
+ SimpleFile::DefinedAtomRange atomRange = mergedFile->definedAtoms();
// Build follow on tables
buildFollowOnTable(atomRange);
diff --git a/lld/lib/ReaderWriter/MachO/LayoutPass.h b/lld/lib/ReaderWriter/MachO/LayoutPass.h
index 186f29be071..2b31e0eed3d 100644
--- a/lld/lib/ReaderWriter/MachO/LayoutPass.h
+++ b/lld/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 <map>
#include <string>
@@ -20,7 +21,7 @@
namespace lld {
class DefinedAtom;
-class MutableFile;
+class SimpleFile;
namespace mach_o {
@@ -45,17 +46,17 @@ public:
LayoutPass(const Registry &registry, SortOverride sorter);
/// Sorts atoms in mergedFile by content type then by command line order.
- void perform(std::unique_ptr<MutableFile> &mergedFile) override;
+ void perform(std::unique_ptr<SimpleFile> &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 @@ private:
void setChainRoot(const DefinedAtom *targetAtom, const DefinedAtom *root);
- std::vector<SortKey> decorate(MutableFile::DefinedAtomRange &atomRange) const;
- void undecorate(MutableFile::DefinedAtomRange &atomRange,
+ std::vector<SortKey> decorate(SimpleFile::DefinedAtomRange &atomRange) const;
+ void undecorate(SimpleFile::DefinedAtomRange &atomRange,
std::vector<SortKey> &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
diff --git a/lld/lib/ReaderWriter/MachO/ShimPass.cpp b/lld/lib/ReaderWriter/MachO/ShimPass.cpp
index a8c69f8ceac..8d53c230b7d 100644
--- a/lld/lib/ReaderWriter/MachO/ShimPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/ShimPass.cpp
@@ -47,8 +47,7 @@ public:
, _file("<mach-o shim pass>") {
}
-
- void perform(std::unique_ptr<MutableFile> &mergedFile) override {
+ void perform(std::unique_ptr<SimpleFile> &mergedFile) override {
// Scan all references in all atoms.
for (const DefinedAtom *atom : mergedFile->defined()) {
for (const Reference *ref : *atom) {
diff --git a/lld/lib/ReaderWriter/MachO/StubsPass.cpp b/lld/lib/ReaderWriter/MachO/StubsPass.cpp
index aac3a60cb43..5c4bb2cccf4 100644
--- a/lld/lib/ReaderWriter/MachO/StubsPass.cpp
+++ b/lld/lib/ReaderWriter/MachO/StubsPass.cpp
@@ -209,8 +209,7 @@ public:
: _context(context), _archHandler(_context.archHandler()),
_stubInfo(_archHandler.stubInfo()), _file("<mach-o Stubs pass>") { }
-
- void perform(std::unique_ptr<MutableFile> &mergedFile) override {
+ void perform(std::unique_ptr<SimpleFile> &mergedFile) override {
// Skip this pass if output format uses text relocations instead of stubs.
if (!this->noTextRelocs())
return;
diff --git a/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp b/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
index ad79f171f3c..2c91ffb33c6 100644
--- a/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/EdataPass.cpp
@@ -78,7 +78,7 @@ static void assignOrdinals(PECOFFLinkingContext &ctx) {
desc.ordinal = nextOrdinal++;
}
-static bool getExportedAtoms(PECOFFLinkingContext &ctx, MutableFile *file,
+static bool getExportedAtoms(PECOFFLinkingContext &ctx, SimpleFile *file,
std::vector<TableEntry> &ret) {
std::map<StringRef, const DefinedAtom *> definedAtoms;
for (const DefinedAtom *atom : file->defined())
@@ -135,7 +135,7 @@ EdataPass::createAddressTable(const std::vector<TableEntry> &entries,
edata::EdataAtom *
EdataPass::createNamePointerTable(const PECOFFLinkingContext &ctx,
const std::vector<TableEntry> &entries,
- MutableFile *file) {
+ SimpleFile *file) {
EdataAtom *table =
new (_alloc) EdataAtom(_file, sizeof(uint32_t) * entries.size());
@@ -175,7 +175,7 @@ EdataPass::createOrdinalTable(const std::vector<TableEntry> &entries,
return ret;
}
-void EdataPass::perform(std::unique_ptr<MutableFile> &file) {
+void EdataPass::perform(std::unique_ptr<SimpleFile> &file) {
dedupExports(_ctx);
assignOrdinals(_ctx);
diff --git a/lld/lib/ReaderWriter/PECOFF/EdataPass.h b/lld/lib/ReaderWriter/PECOFF/EdataPass.h
index 442be3ca24a..0132c9ca5f2 100644
--- a/lld/lib/ReaderWriter/PECOFF/EdataPass.h
+++ b/lld/lib/ReaderWriter/PECOFF/EdataPass.h
@@ -66,7 +66,7 @@ public:
EdataPass(PECOFFLinkingContext &ctx)
: _ctx(ctx), _file(ctx), _is64(ctx.is64Bit()), _stringOrdinal(1024) {}
- void perform(std::unique_ptr<MutableFile> &file) override;
+ void perform(std::unique_ptr<SimpleFile> &file) override;
private:
edata::EdataAtom *
@@ -80,7 +80,7 @@ private:
edata::EdataAtom *
createNamePointerTable(const PECOFFLinkingContext &ctx,
const std::vector<edata::TableEntry> &entries,
- MutableFile *file);
+ SimpleFile *file);
edata::EdataAtom *
createOrdinalTable(const std::vector<edata::TableEntry> &entries,
diff --git a/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp b/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp
index 8eed472a329..e19024a15d3 100644
--- a/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/IdataPass.cpp
@@ -143,8 +143,8 @@ std::vector<uint8_t> DelayImportDirectoryAtom::createContent() {
// 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 @@ DelayLoaderAtom::createContent(MachineTypes machine) const {
} // namespace idata
-void IdataPass::perform(std::unique_ptr<MutableFile> &file) {
+void IdataPass::perform(std::unique_ptr<SimpleFile> &file) {
if (file->sharedLibrary().empty())
return;
@@ -324,8 +324,8 @@ void IdataPass::perform(std::unique_ptr<MutableFile> &file) {
replaceSharedLibraryAtoms(*file);
}
-std::map<StringRef, std::vector<COFFSharedLibraryAtom *> >
-IdataPass::groupByLoadName(MutableFile &file) {
+std::map<StringRef, std::vector<COFFSharedLibraryAtom *>>
+IdataPass::groupByLoadName(SimpleFile &file) {
std::map<StringRef, COFFSharedLibraryAtom *> uniqueAtoms;
for (const SharedLibraryAtom *atom : file.sharedLibrary())
uniqueAtoms[atom->name()] =
@@ -340,7 +340,7 @@ IdataPass::groupByLoadName(MutableFile &file) {
}
/// 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();
diff --git a/lld/lib/ReaderWriter/PECOFF/IdataPass.h b/lld/lib/ReaderWriter/PECOFF/IdataPass.h
index 7374c82d8f3..7cf41558369 100644
--- a/lld/lib/ReaderWriter/PECOFF/IdataPass.h
+++ b/lld/lib/ReaderWriter/PECOFF/IdataPass.h
@@ -40,9 +40,9 @@ class ImportTableEntryAtom;
// 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 @@ class IdataPass : public lld::Pass {
public:
IdataPass(const PECOFFLinkingContext &ctx) : _dummyFile(ctx), _ctx(ctx) {}
- void perform(std::unique_ptr<MutableFile> &file) override;
+ void perform(std::unique_ptr<SimpleFile> &file) override;
private:
std::map<StringRef, std::vector<COFFSharedLibraryAtom *>>
- 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
diff --git a/lld/lib/ReaderWriter/PECOFF/InferSubsystemPass.h b/lld/lib/ReaderWriter/PECOFF/InferSubsystemPass.h
index cbf863ee478..f17c26e7a98 100644
--- a/lld/lib/ReaderWriter/PECOFF/InferSubsystemPass.h
+++ b/lld/lib/ReaderWriter/PECOFF/InferSubsystemPass.h
@@ -22,7 +22,7 @@ class InferSubsystemPass : public lld::Pass {
public:
InferSubsystemPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {}
- void perform(std::unique_ptr<MutableFile> &file) override {
+ void perform(std::unique_ptr<SimpleFile> &file) override {
if (_ctx.getSubsystem() != WindowsSubsystem::IMAGE_SUBSYSTEM_UNKNOWN)
return;
diff --git a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp
index be2f5627f4e..f2a9609e863 100644
--- a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp
+++ b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp
@@ -49,7 +49,7 @@ LoadConfigAtom::LoadConfigAtom(VirtualFile &file, const DefinedAtom *sxdata,
} // namespace loadcfg
-void LoadConfigPass::perform(std::unique_ptr<MutableFile> &file) {
+void LoadConfigPass::perform(std::unique_ptr<SimpleFile> &file) {
if (_ctx.noSEH())
return;
diff --git a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h
index 9f4a25f2b10..c8ab5944701 100644
--- a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h
+++ b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.h
@@ -49,7 +49,7 @@ class LoadConfigPass : public lld::Pass {
public:
LoadConfigPass(PECOFFLinkingContext &ctx) : _ctx(ctx), _file(ctx) {}
- void perform(std::unique_ptr<MutableFile> &file) override;
+ void perform(std::unique_ptr<SimpleFile> &file) override;
private:
PECOFFLinkingContext &_ctx;
diff --git a/lld/lib/ReaderWriter/PECOFF/OrderPass.h b/lld/lib/ReaderWriter/PECOFF/OrderPass.h
index 73133ff7363..9ffe179487a 100644
--- a/lld/lib/ReaderWriter/PECOFF/OrderPass.h
+++ b/lld/lib/ReaderWriter/PECOFF/OrderPass.h
@@ -55,8 +55,8 @@ static bool compare(const DefinedAtom *lhs, const DefinedAtom *rhs) {
class OrderPass : public lld::Pass {
public:
- void perform(std::unique_ptr<MutableFile> &file) override {
- MutableFile::DefinedAtomRange defined = file->definedAtoms();
+ void perform(std::unique_ptr<SimpleFile> &file) override {
+ SimpleFile::DefinedAtomRange defined = file->definedAtoms();
parallel_sort(defined.begin(), defined.end(), compare);
}
};
diff --git a/lld/lib/ReaderWriter/PECOFF/PDBPass.h b/lld/lib/ReaderWriter/PECOFF/PDBPass.h
index 0efa054db82..2fbe60eed98 100644
--- a/lld/lib/ReaderWriter/PECOFF/PDBPass.h
+++ b/lld/lib/ReaderWriter/PECOFF/PDBPass.h
@@ -21,7 +21,7 @@ class PDBPass : public lld::Pass {
public:
PDBPass(PECOFFLinkingContext &ctx) : _ctx(ctx) {}
- void perform(std::unique_ptr<MutableFile> &file) override {
+ void perform(std::unique_ptr<SimpleFile> &file) override {
if (_ctx.getDebug())
touch(_ctx.getPDBFilePath());
}
OpenPOWER on IntegriCloud