[lld] r274048 - [lld][MachO] Remove SimpleFile::definedAtoms().
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 28 11:42:34 PDT 2016
Author: lhames
Date: Tue Jun 28 13:42:33 2016
New Revision: 274048
URL: http://llvm.org/viewvc/llvm-project?rev=274048&view=rev
Log:
[lld][MachO] Remove SimpleFile::definedAtoms().
This method just duplicates the functionality of SimpleFile::defined().
Modified:
lld/trunk/include/lld/Core/Simple.h
lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp
lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h
Modified: lld/trunk/include/lld/Core/Simple.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Simple.h?rev=274048&r1=274047&r2=274048&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Simple.h (original)
+++ lld/trunk/include/lld/Core/Simple.h Tue Jun 28 13:42:33 2016
@@ -104,9 +104,6 @@ public:
_absolute.clear();
}
- typedef AtomRange<DefinedAtom> DefinedAtomRange;
- DefinedAtomRange definedAtoms() { return _defined; }
-
private:
AtomVector<DefinedAtom> _defined;
AtomVector<UndefinedAtom> _undefined;
Modified: lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp?rev=274048&r1=274047&r2=274048&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/LayoutPass.cpp Tue Jun 28 13:42:33 2016
@@ -134,7 +134,7 @@ static void checkReachabilityFromRoot(At
}
}
-static void printDefinedAtoms(const SimpleFile::DefinedAtomRange &atomRange) {
+static void printDefinedAtoms(const File::AtomRange<DefinedAtom> &atomRange) {
for (const DefinedAtom *atom : atomRange) {
llvm::dbgs() << " file=" << atom->file().path()
<< ", name=" << atom->name()
@@ -147,7 +147,7 @@ static void printDefinedAtoms(const Simp
/// Verify that the followon chain is sane. Should not be called in
/// release binary.
-void LayoutPass::checkFollowonChain(const SimpleFile::DefinedAtomRange &range) {
+void LayoutPass::checkFollowonChain(const File::AtomRange<DefinedAtom> &range) {
ScopedTask task(getDefaultDomain(), "LayoutPass::checkFollowonChain");
// Verify that there's no cycle in follow-on chain.
@@ -331,7 +331,7 @@ void LayoutPass::setChainRoot(const Defi
/// 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(const SimpleFile::DefinedAtomRange &range) {
+void LayoutPass::buildFollowOnTable(const File::AtomRange<DefinedAtom> &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.
@@ -400,7 +400,7 @@ void LayoutPass::buildFollowOnTable(cons
/// 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(const SimpleFile::DefinedAtomRange &range) {
+LayoutPass::buildOrdinalOverrideMap(const File::AtomRange<DefinedAtom> &range) {
ScopedTask task(getDefaultDomain(), "LayoutPass::buildOrdinalOverrideMap");
uint64_t index = 0;
for (const DefinedAtom *ai : range) {
@@ -420,7 +420,7 @@ LayoutPass::buildOrdinalOverrideMap(cons
}
std::vector<LayoutPass::SortKey>
-LayoutPass::decorate(SimpleFile::DefinedAtomRange &atomRange) const {
+LayoutPass::decorate(File::AtomRange<DefinedAtom> &atomRange) const {
std::vector<SortKey> ret;
for (OwningAtomPtr<DefinedAtom> &atom : atomRange.owning_ptrs()) {
auto ri = _followOnRoots.find(atom.get());
@@ -432,7 +432,7 @@ LayoutPass::decorate(SimpleFile::Defined
return ret;
}
-void LayoutPass::undecorate(SimpleFile::DefinedAtomRange &atomRange,
+void LayoutPass::undecorate(File::AtomRange<DefinedAtom> &atomRange,
std::vector<SortKey> &keys) const {
size_t i = 0;
for (SortKey &k : keys)
@@ -444,7 +444,7 @@ llvm::Error LayoutPass::perform(SimpleFi
DEBUG(llvm::dbgs() << "******** Laying out atoms:\n");
// sort the atoms
ScopedTask task(getDefaultDomain(), "LayoutPass");
- SimpleFile::DefinedAtomRange atomRange = mergedFile.definedAtoms();
+ File::AtomRange<DefinedAtom> atomRange = mergedFile.defined();
// 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=274048&r1=274047&r2=274048&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h (original)
+++ lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h Tue Jun 28 13:42:33 2016
@@ -73,10 +73,10 @@ public:
private:
// Build the followOn atoms chain as specified by the kindLayoutAfter
// reference type
- void buildFollowOnTable(const SimpleFile::DefinedAtomRange &range);
+ void buildFollowOnTable(const File::AtomRange<DefinedAtom> &range);
// Build a map of Atoms to ordinals for sorting the atoms
- void buildOrdinalOverrideMap(const SimpleFile::DefinedAtomRange &range);
+ void buildOrdinalOverrideMap(const File::AtomRange<DefinedAtom> &range);
const Registry &_registry;
SortOverride _customSorter;
@@ -104,13 +104,13 @@ private:
void setChainRoot(const DefinedAtom *targetAtom, const DefinedAtom *root);
- std::vector<SortKey> decorate(SimpleFile::DefinedAtomRange &atomRange) const;
+ std::vector<SortKey> decorate(File::AtomRange<DefinedAtom> &atomRange) const;
- void undecorate(SimpleFile::DefinedAtomRange &atomRange,
+ void undecorate(File::AtomRange<DefinedAtom> &atomRange,
std::vector<SortKey> &keys) const;
// Check if the follow-on graph is a correct structure. For debugging only.
- void checkFollowonChain(const SimpleFile::DefinedAtomRange &range);
+ void checkFollowonChain(const File::AtomRange<DefinedAtom> &range);
};
} // namespace mach_o
More information about the llvm-commits
mailing list