[lld] r234938 - ELF: Remove redundant namespace qualifiers.
Rui Ueyama
ruiu at google.com
Tue Apr 14 13:39:07 PDT 2015
Author: ruiu
Date: Tue Apr 14 15:39:06 2015
New Revision: 234938
URL: http://llvm.org/viewvc/llvm-project?rev=234938&view=rev
Log:
ELF: Remove redundant namespace qualifiers.
Modified:
lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h
lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h
lld/trunk/lib/ReaderWriter/ELF/Atoms.h
lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp
lld/trunk/lib/ReaderWriter/ELF/DynamicLibraryWriter.h
lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
lld/trunk/lib/ReaderWriter/ELF/SectionChunks.cpp
lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
lld/trunk/lib/ReaderWriter/ELF/TargetLayout.cpp
lld/trunk/lib/ReaderWriter/ELF/TargetLayout.h
lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp Tue Apr 14 15:39:06 2015
@@ -400,7 +400,7 @@ static void relocR_AARCH64_TLSLE_ADD_TPR
}
std::error_code AArch64TargetRelocationHandler::applyRelocation(
- ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom,
+ ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom,
const Reference &ref) const {
uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset;
uint8_t *loc = atomContent + ref.offsetInAtom();
Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.h Tue Apr 14 15:39:06 2015
@@ -18,7 +18,7 @@ namespace elf {
class AArch64TargetRelocationHandler final : public TargetRelocationHandler {
public:
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
- const lld::AtomLayout &,
+ const AtomLayout &,
const Reference &) const override;
};
Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.cpp Tue Apr 14 15:39:06 2015
@@ -497,7 +497,7 @@ static void relocR_ARM_LDR_PC_G2(uint8_t
}
std::error_code ARMTargetRelocationHandler::applyRelocation(
- ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom,
+ ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom,
const Reference &ref) const {
uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset;
uint8_t *loc = atomContent + ref.offsetInAtom();
Modified: lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ARM/ARMRelocationHandler.h Tue Apr 14 15:39:06 2015
@@ -22,7 +22,7 @@ public:
ARMTargetRelocationHandler(ARMTargetLayout &layout) : _armLayout(layout) {}
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
- const lld::AtomLayout &,
+ const AtomLayout &,
const Reference &) const override;
private:
Modified: lld/trunk/lib/ReaderWriter/ELF/Atoms.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Atoms.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Atoms.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Atoms.h Tue Apr 14 15:39:06 2015
@@ -102,7 +102,7 @@ private:
/// \brief ELFUndefinedAtom: These atoms store undefined symbols and are place
/// holders that will be replaced by defined atoms later in the linking process.
-template <class ELFT> class ELFUndefinedAtom : public lld::UndefinedAtom {
+template <class ELFT> class ELFUndefinedAtom : public UndefinedAtom {
typedef llvm::object::Elf_Sym_Impl<ELFT> Elf_Sym;
public:
Modified: lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp Tue Apr 14 15:39:06 2015
@@ -26,7 +26,7 @@ DynamicFile<ELFT>::DynamicFile(std::uniq
template <typename ELFT>
std::error_code DynamicFile<ELFT>::isCompatible(const MemoryBuffer &mb,
ELFLinkingContext &ctx) {
- return lld::elf::isCompatible<ELFT>(mb, ctx);
+ return elf::isCompatible<ELFT>(mb, ctx);
}
template <class ELFT>
Modified: lld/trunk/lib/ReaderWriter/ELF/DynamicLibraryWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DynamicLibraryWriter.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DynamicLibraryWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DynamicLibraryWriter.h Tue Apr 14 15:39:06 2015
@@ -68,7 +68,7 @@ void DynamicLibraryWriter<ELFT>::createI
template <class ELFT>
void DynamicLibraryWriter<ELFT>::finalizeDefaultAtomValues() {
OutputELFWriter<ELFT>::finalizeDefaultAtomValues();
- lld::AtomLayout *underScoreEndAtom = this->_layout.findAbsoluteAtom("_end");
+ AtomLayout *underScoreEndAtom = this->_layout.findAbsoluteAtom("_end");
assert(underScoreEndAtom);
if (auto bssSection = this->_layout.findOutputSection(".bss")) {
Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp Tue Apr 14 15:39:06 2015
@@ -30,7 +30,7 @@ ELFFile<ELFT>::ELFFile(std::unique_ptr<M
template <typename ELFT>
std::error_code ELFFile<ELFT>::isCompatible(const MemoryBuffer &mb,
ELFLinkingContext &ctx) {
- return lld::elf::isCompatible<ELFT>(mb, ctx);
+ return elf::isCompatible<ELFT>(mb, ctx);
}
template <typename ELFT>
@@ -319,7 +319,7 @@ template <class ELFT> std::error_code EL
followOn = anonFollowedBy;
} else {
followOn = new (_readerStorage)
- ELFReference<ELFT>(lld::Reference::kindLayoutAfter);
+ ELFReference<ELFT>(Reference::kindLayoutAfter);
previousAtom->addReference(followOn);
}
}
@@ -362,7 +362,7 @@ template <class ELFT> std::error_code EL
// If this is the last atom, let's not create a followon reference.
if (anonAtom && (si + 1) != se) {
anonFollowedBy = new (_readerStorage)
- ELFReference<ELFT>(lld::Reference::kindLayoutAfter);
+ ELFReference<ELFT>(Reference::kindLayoutAfter);
anonAtom->addReference(anonFollowedBy);
}
}
@@ -429,7 +429,7 @@ std::error_code ELFFile<ELFT>::handleGnu
for (auto ha : atomsForSection[*sectionName]) {
_groupChild[ha->symbol()] = std::make_pair(*sectionName, section);
ELFReference<ELFT> *ref =
- new (_readerStorage) ELFReference<ELFT>(lld::Reference::kindGroupChild);
+ new (_readerStorage) ELFReference<ELFT>(Reference::kindGroupChild);
ref->setTarget(ha);
refs.push_back(ref);
}
@@ -490,8 +490,8 @@ std::error_code ELFFile<ELFT>::handleSec
for (auto name : sectionNames) {
for (auto ha : atomsForSection[name]) {
_groupChild[ha->symbol()] = std::make_pair(*symbolName, section);
- ELFReference<ELFT> *ref = new (_readerStorage)
- ELFReference<ELFT>(lld::Reference::kindGroupChild);
+ ELFReference<ELFT> *ref =
+ new (_readerStorage) ELFReference<ELFT>(Reference::kindGroupChild);
ref->setTarget(ha);
refs.push_back(ref);
}
@@ -631,7 +631,7 @@ void ELFFile<ELFT>::updateReferenceForMe
template <class ELFT> void ELFFile<ELFT>::updateReferences() {
for (auto &ri : _references) {
- if (ri->kindNamespace() != lld::Reference::KindNamespace::ELF)
+ if (ri->kindNamespace() != Reference::KindNamespace::ELF)
continue;
const Elf_Sym *symbol = _objFile->getSymbol(ri->targetSymbolIndex());
const Elf_Shdr *shdr = _objFile->getSection(symbol);
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonLinkingContext.cpp Tue Apr 14 15:39:06 2015
@@ -13,7 +13,7 @@
namespace lld {
namespace elf {
-std::unique_ptr<lld::ELFLinkingContext>
+std::unique_ptr<ELFLinkingContext>
createHexagonLinkingContext(llvm::Triple triple) {
if (triple.getArch() == llvm::Triple::hexagon)
return llvm::make_unique<HexagonLinkingContext>(triple);
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp Tue Apr 14 15:39:06 2015
@@ -224,7 +224,7 @@ static void relocHexGOTREL_32(uint8_t *l
}
std::error_code HexagonTargetRelocationHandler::applyRelocation(
- ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom,
+ ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom,
const Reference &ref) const {
uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset;
uint8_t *loc = atomContent + ref.offsetInAtom();
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h Tue Apr 14 15:39:06 2015
@@ -22,7 +22,7 @@ public:
: _targetLayout(layout) {}
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
- const lld::AtomLayout &,
+ const AtomLayout &,
const Reference &) const override;
private:
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=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Tue Apr 14 15:39:06 2015
@@ -314,8 +314,8 @@ void HexagonLinkingContext::addPasses(Pa
void SDataSection::doPreFlight() {
// sort the atoms on the alignments they have been set
- std::stable_sort(_atoms.begin(), _atoms.end(), [](const lld::AtomLayout *A,
- const lld::AtomLayout *B) {
+ std::stable_sort(_atoms.begin(), _atoms.end(), [](const AtomLayout *A,
+ const AtomLayout *B) {
const DefinedAtom *definedAtomA = cast<DefinedAtom>(A->_atom);
const DefinedAtom *definedAtomB = cast<DefinedAtom>(B->_atom);
int64_t alignmentA = definedAtomA->alignment().value;
@@ -353,7 +353,7 @@ const AtomLayout *SDataSection::appendAt
const DefinedAtom *definedAtom = cast<DefinedAtom>(atom);
DefinedAtom::Alignment atomAlign = definedAtom->alignment();
uint64_t alignment = atomAlign.value;
- _atoms.push_back(new (_alloc) lld::AtomLayout(atom, 0, 0));
+ _atoms.push_back(new (_alloc) AtomLayout(atom, 0, 0));
// Set the section alignment to the largest alignment
// std::max doesn't support uint64_t
if (_alignment < alignment)
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h Tue Apr 14 15:39:06 2015
@@ -30,7 +30,7 @@ public:
/// \brief Does this section have an output segment.
bool hasOutputSegment() const override { return true; }
- const lld::AtomLayout *appendAtom(const Atom *atom) override;
+ const AtomLayout *appendAtom(const Atom *atom) override;
};
/// \brief TargetLayout for Hexagon
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp Tue Apr 14 15:39:06 2015
@@ -38,7 +38,7 @@ public:
std::error_code applyRelocation(ELFWriter &writer,
llvm::FileOutputBuffer &buf,
- const lld::AtomLayout &atom,
+ const AtomLayout &atom,
const Reference &ref) const override;
private:
@@ -556,9 +556,9 @@ static void relocWrite(uint64_t data, co
template <class ELFT>
std::error_code RelocationHandler<ELFT>::applyRelocation(
- ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom,
+ ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom,
const Reference &ref) const {
- if (ref.kindNamespace() != lld::Reference::KindNamespace::ELF)
+ if (ref.kindNamespace() != Reference::KindNamespace::ELF)
return std::error_code();
assert(ref.kindArch() == Reference::KindArch::Mips);
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=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Tue Apr 14 15:39:06 2015
@@ -507,7 +507,7 @@ void RelocationPass<ELFT>::handleReferen
Reference &ref) {
if (!ref.target())
return;
- if (ref.kindNamespace() != lld::Reference::KindNamespace::ELF)
+ if (ref.kindNamespace() != Reference::KindNamespace::ELF)
return;
assert(ref.kindArch() == Reference::KindArch::Mips);
switch (ref.kindValue()) {
@@ -602,7 +602,7 @@ void RelocationPass<ELFT>::collectRefere
const MipsELFDefinedAtom<ELFT> &atom, Reference &ref) {
if (!ref.target())
return;
- if (ref.kindNamespace() != lld::Reference::KindNamespace::ELF)
+ if (ref.kindNamespace() != Reference::KindNamespace::ELF)
return;
auto refKind = ref.kindValue();
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h Tue Apr 14 15:39:06 2015
@@ -152,11 +152,11 @@ public:
return ia == _posMap.end() && ib != _posMap.end();
}
- const lld::AtomLayout *appendAtom(const Atom *atom) override {
+ const AtomLayout *appendAtom(const Atom *atom) override {
const DefinedAtom *da = dyn_cast<DefinedAtom>(atom);
for (const auto &r : *da) {
- if (r->kindNamespace() != lld::Reference::KindNamespace::ELF)
+ if (r->kindNamespace() != Reference::KindNamespace::ELF)
continue;
assert(r->kindArch() == Reference::KindArch::Mips);
switch (r->kindValue()) {
@@ -211,13 +211,13 @@ public:
return it != _pltLayoutMap.end() ? it->second : nullptr;
}
- const lld::AtomLayout *appendAtom(const Atom *atom) override {
+ const AtomLayout *appendAtom(const Atom *atom) override {
const auto *layout = AtomSection<ELFT>::appendAtom(atom);
const DefinedAtom *da = cast<DefinedAtom>(atom);
for (const auto &r : *da) {
- if (r->kindNamespace() != lld::Reference::KindNamespace::ELF)
+ if (r->kindNamespace() != Reference::KindNamespace::ELF)
continue;
assert(r->kindArch() == Reference::KindArch::Mips);
if (r->kindValue() == LLD_R_MIPS_STO_PLT) {
Modified: lld/trunk/lib/ReaderWriter/ELF/SectionChunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/SectionChunks.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/SectionChunks.cpp Tue Apr 14 15:39:06 2015
@@ -161,7 +161,7 @@ uint64_t AtomSection<ELFT>::alignOffset(
// contains the atom, the atom file offset, the atom virtual address
// the atom file offset is aligned appropriately as set by the Reader
template <class ELFT>
-const lld::AtomLayout *AtomSection<ELFT>::appendAtom(const Atom *atom) {
+const AtomLayout *AtomSection<ELFT>::appendAtom(const Atom *atom) {
const DefinedAtom *definedAtom = cast<DefinedAtom>(atom);
DefinedAtom::Alignment atomAlign = definedAtom->alignment();
@@ -183,7 +183,7 @@ const lld::AtomLayout *AtomSection<ELFT>
case DefinedAtom::typeThreadData:
case DefinedAtom::typeRONote:
case DefinedAtom::typeRWNote:
- _atoms.push_back(new (_alloc) lld::AtomLayout(atom, fOffset, 0));
+ _atoms.push_back(new (_alloc) AtomLayout(atom, fOffset, 0));
this->_fsize = fOffset + definedAtom->size();
this->_msize = mOffset + definedAtom->size();
DEBUG_WITH_TYPE("Section", llvm::dbgs()
@@ -192,7 +192,7 @@ const lld::AtomLayout *AtomSection<ELFT>
<< fOffset << "\n");
break;
case DefinedAtom::typeNoAlloc:
- _atoms.push_back(new (_alloc) lld::AtomLayout(atom, fOffset, 0));
+ _atoms.push_back(new (_alloc) AtomLayout(atom, fOffset, 0));
this->_fsize = fOffset + definedAtom->size();
DEBUG_WITH_TYPE("Section", llvm::dbgs()
<< "[" << this->name() << " " << this << "] "
@@ -201,7 +201,7 @@ const lld::AtomLayout *AtomSection<ELFT>
break;
case DefinedAtom::typeThreadZeroFill:
case DefinedAtom::typeZeroFill:
- _atoms.push_back(new (_alloc) lld::AtomLayout(atom, mOffset, 0));
+ _atoms.push_back(new (_alloc) AtomLayout(atom, mOffset, 0));
this->_msize = mOffset + definedAtom->size();
break;
default:
@@ -249,7 +249,7 @@ void AtomSection<ELFT>::write(ELFWriter
llvm::FileOutputBuffer &buffer) {
uint8_t *chunkBuffer = buffer.getBufferStart();
bool success = true;
- parallel_for_each(_atoms.begin(), _atoms.end(), [&](lld::AtomLayout *ai) {
+ parallel_for_each(_atoms.begin(), _atoms.end(), [&](AtomLayout *ai) {
DEBUG_WITH_TYPE("Section", llvm::dbgs()
<< "Writing atom: " << ai->_atom->name()
<< " | " << ai->_fileOffset << "\n");
@@ -461,8 +461,7 @@ void SymbolTable<ELFT>::addUndefinedAtom
/// information
template <class ELFT>
void SymbolTable<ELFT>::addSymbol(const Atom *atom, int32_t sectionIndex,
- uint64_t addr,
- const lld::AtomLayout *atomLayout) {
+ uint64_t addr, const AtomLayout *atomLayout) {
Elf_Sym symbol;
if (atom->name().empty())
@@ -548,7 +547,7 @@ template <class ELFT> void DynamicSymbol
// don't have their addresses known until addresses have been assigned
// so let's update the symbol values after they have got assigned
for (auto &ste : this->_symbolTable) {
- const lld::AtomLayout *atomLayout = ste._atomLayout;
+ const AtomLayout *atomLayout = ste._atomLayout;
if (!atomLayout)
continue;
ste._symbol.st_value = atomLayout->_virtualAddr;
Modified: lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/SectionChunks.h Tue Apr 14 15:39:06 2015
@@ -156,7 +156,7 @@ public:
// \brief Append an atom to a Section. The atom gets pushed into a vector
// contains the atom, the atom file offset, the atom virtual address
// the atom file offset is aligned appropriately as set by the Reader
- virtual const lld::AtomLayout *appendAtom(const Atom *atom);
+ virtual const AtomLayout *appendAtom(const Atom *atom);
/// \brief Set the virtual address of each Atom in the Section. This
/// routine gets called after the linker fixes up the virtual address
@@ -176,7 +176,7 @@ public:
int64_t atomflags() const { return _contentPermissions; }
/// Atom Iterators
- typedef typename std::vector<lld::AtomLayout *>::iterator atom_iter;
+ typedef typename std::vector<AtomLayout *>::iterator atom_iter;
range<atom_iter> atoms() { return _atoms; }
@@ -192,7 +192,7 @@ protected:
int32_t _contentType;
int32_t _contentPermissions;
bool _isLoadedInMemory = true;
- std::vector<lld::AtomLayout *> _atoms;
+ std::vector<AtomLayout *> _atoms;
mutable std::mutex _outputMutex;
void printError(const std::string &errorStr, const AtomLayout &atom,
@@ -334,7 +334,7 @@ public:
std::size_t size() const { return _symbolTable.size(); }
void addSymbol(const Atom *atom, int32_t sectionIndex, uint64_t addr = 0,
- const lld::AtomLayout *layout = nullptr);
+ const AtomLayout *layout = nullptr);
/// \brief Get the symbol table index for an Atom. If it's not in the symbol
/// table, return STN_UNDEF.
@@ -375,12 +375,11 @@ public:
protected:
struct SymbolEntry {
- SymbolEntry(const Atom *a, const Elf_Sym &sym,
- const lld::AtomLayout *layout)
+ SymbolEntry(const Atom *a, const Elf_Sym &sym, const AtomLayout *layout)
: _atom(a), _atomLayout(layout), _symbol(sym) {}
const Atom *_atom;
- const lld::AtomLayout *_atomLayout;
+ const AtomLayout *_atomLayout;
Elf_Sym _symbol;
};
Modified: lld/trunk/lib/ReaderWriter/ELF/TargetLayout.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/TargetLayout.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/TargetLayout.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/TargetLayout.cpp Tue Apr 14 15:39:06 2015
@@ -252,7 +252,7 @@ TargetLayout<ELFT>::getSection(StringRef
}
template <class ELFT>
-ErrorOr<const lld::AtomLayout *> TargetLayout<ELFT>::addAtom(const Atom *atom) {
+ErrorOr<const AtomLayout *> TargetLayout<ELFT>::addAtom(const Atom *atom) {
if (const DefinedAtom *definedAtom = dyn_cast<DefinedAtom>(atom)) {
// HACK: Ignore undefined atoms. We need to adjust the interface so that
// undefined atoms can still be included in the output symbol table for
@@ -299,7 +299,7 @@ ErrorOr<const lld::AtomLayout *> TargetL
// Absolute atoms are not part of any section, they are global for the whole
// link
_absoluteAtoms.push_back(
- new (_allocator) lld::AtomLayout(absoluteAtom, 0, absoluteAtom->value()));
+ new (_allocator) AtomLayout(absoluteAtom, 0, absoluteAtom->value()));
return _absoluteAtoms.back();
}
Modified: lld/trunk/lib/ReaderWriter/ELF/TargetLayout.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/TargetLayout.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/TargetLayout.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/TargetLayout.h Tue Apr 14 15:39:06 2015
@@ -148,7 +148,7 @@ public:
typedef std::unordered_map<SegmentKey, Segment<ELFT> *, SegmentHashKey>
SegmentMapT;
- typedef typename std::vector<lld::AtomLayout *>::iterator AbsoluteAtomIterT;
+ typedef typename std::vector<AtomLayout *>::iterator AbsoluteAtomIterT;
typedef llvm::DenseSet<const Atom *> AtomSetT;
@@ -187,7 +187,7 @@ public:
/// \brief Append the Atom to the layout and create appropriate sections.
/// \returns A reference to the atom layout or an error. The atom layout will
/// be updated as linking progresses.
- virtual ErrorOr<const lld::AtomLayout *> addAtom(const Atom *atom);
+ virtual ErrorOr<const AtomLayout *> addAtom(const Atom *atom);
/// \brief Find an output Section given a section name.
OutputSection<ELFT> *findOutputSection(StringRef name) {
@@ -198,7 +198,7 @@ public:
}
/// \brief find a absolute atom given a name
- lld::AtomLayout *findAbsoluteAtom(StringRef name) {
+ AtomLayout *findAbsoluteAtom(StringRef name) {
auto iter = std::find_if(
_absoluteAtoms.begin(), _absoluteAtoms.end(),
[=](const AtomLayout *a) { return a->_atom->name() == name; });
@@ -314,7 +314,7 @@ protected:
ProgramHeader<ELFT> *_programHeader;
unique_bump_ptr<RelocationTable<ELFT>> _dynamicRelocationTable;
unique_bump_ptr<RelocationTable<ELFT>> _pltRelocationTable;
- std::vector<lld::AtomLayout *> _absoluteAtoms;
+ std::vector<AtomLayout *> _absoluteAtoms;
AtomSetT _referencedDynAtoms;
llvm::StringSet<> _copiedDynSymNames;
ELFLinkingContext &_ctx;
Modified: lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.cpp Tue Apr 14 15:39:06 2015
@@ -30,7 +30,7 @@ static int relocPC32(uint8_t *location,
}
std::error_code X86TargetRelocationHandler::applyRelocation(
- ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom,
+ ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom,
const Reference &ref) const {
uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset;
uint8_t *loc = atomContent + ref.offsetInAtom();
Modified: lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86/X86RelocationHandler.h Tue Apr 14 15:39:06 2015
@@ -18,7 +18,7 @@ namespace elf {
class X86TargetRelocationHandler final : public TargetRelocationHandler {
public:
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
- const lld::AtomLayout &,
+ const AtomLayout &,
const Reference &) const override;
};
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.cpp Tue Apr 14 15:39:06 2015
@@ -62,7 +62,7 @@ static void relocPC64(uint8_t *location,
}
std::error_code X86_64TargetRelocationHandler::applyRelocation(
- ELFWriter &writer, llvm::FileOutputBuffer &buf, const lld::AtomLayout &atom,
+ ELFWriter &writer, llvm::FileOutputBuffer &buf, const AtomLayout &atom,
const Reference &ref) const {
uint8_t *atomContent = buf.getBufferStart() + atom._fileOffset;
uint8_t *loc = atomContent + ref.offsetInAtom();
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h?rev=234938&r1=234937&r2=234938&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h Tue Apr 14 15:39:06 2015
@@ -22,7 +22,7 @@ public:
: _tlsSize(0), _layout(layout) {}
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
- const lld::AtomLayout &,
+ const AtomLayout &,
const Reference &) const override;
private:
More information about the llvm-commits
mailing list