[lld] r233746 - Remove "_hexagon" prefix from some member variables.
Rui Ueyama
ruiu at google.com
Tue Mar 31 13:29:08 PDT 2015
Author: ruiu
Date: Tue Mar 31 15:29:08 2015
New Revision: 233746
URL: http://llvm.org/viewvc/llvm-project?rev=233746&view=rev
Log:
Remove "_hexagon" prefix from some member variables.
At least in Mips we don't have a prefix for member variables.
Repeating the architecture is verbose.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h
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
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h?rev=233746&r1=233745&r2=233746&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonDynamicLibraryWriter.h Tue Mar 31 15:29:08 2015
@@ -38,21 +38,20 @@ protected:
private:
void addDefaultAtoms() override {
- _hexagonRuntimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_");
- _hexagonRuntimeFile->addAbsoluteAtom("_DYNAMIC");
+ _runtimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_");
+ _runtimeFile->addAbsoluteAtom("_DYNAMIC");
}
HexagonLinkingContext &_ctx;
- HexagonTargetLayout<ELFT> &_hexagonTargetLayout;
- std::unique_ptr<HexagonRuntimeFile<ELFT>> _hexagonRuntimeFile;
+ HexagonTargetLayout<ELFT> &_targetLayout;
+ std::unique_ptr<HexagonRuntimeFile<ELFT>> _runtimeFile;
};
template <class ELFT>
HexagonDynamicLibraryWriter<ELFT>::HexagonDynamicLibraryWriter(
HexagonLinkingContext &ctx, HexagonTargetLayout<ELFT> &layout)
- : DynamicLibraryWriter<ELFT>(ctx, layout), _ctx(ctx),
- _hexagonTargetLayout(layout),
- _hexagonRuntimeFile(new HexagonRuntimeFile<ELFT>(ctx)) {}
+ : DynamicLibraryWriter<ELFT>(ctx, layout), _ctx(ctx), _targetLayout(layout),
+ _runtimeFile(new HexagonRuntimeFile<ELFT>(ctx)) {}
template <class ELFT>
bool HexagonDynamicLibraryWriter<ELFT>::createImplicitFiles(
@@ -60,7 +59,7 @@ bool HexagonDynamicLibraryWriter<ELFT>::
DynamicLibraryWriter<ELFT>::createImplicitFiles(result);
// Add the default atoms as defined for hexagon
addDefaultAtoms();
- result.push_back(std::move(_hexagonRuntimeFile));
+ result.push_back(std::move(_runtimeFile));
return true;
}
@@ -69,7 +68,7 @@ void HexagonDynamicLibraryWriter<ELFT>::
// Finalize the atom values that are part of the parent.
DynamicLibraryWriter<ELFT>::finalizeDefaultAtomValues();
if (_ctx.isDynamic())
- finalizeHexagonRuntimeAtomValues(_hexagonTargetLayout);
+ finalizeHexagonRuntimeAtomValues(_targetLayout);
}
} // namespace elf
Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h?rev=233746&r1=233745&r2=233746&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonExecutableWriter.h Tue Mar 31 15:29:08 2015
@@ -38,24 +38,23 @@ protected:
private:
void addDefaultAtoms() override {
- _hexagonRuntimeFile->addAbsoluteAtom("_SDA_BASE_");
+ _runtimeFile->addAbsoluteAtom("_SDA_BASE_");
if (this->_ctx.isDynamic()) {
- _hexagonRuntimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_");
- _hexagonRuntimeFile->addAbsoluteAtom("_DYNAMIC");
+ _runtimeFile->addAbsoluteAtom("_GLOBAL_OFFSET_TABLE_");
+ _runtimeFile->addAbsoluteAtom("_DYNAMIC");
}
}
HexagonLinkingContext &_ctx;
- HexagonTargetLayout<ELFT> &_hexagonTargetLayout;
- std::unique_ptr<HexagonRuntimeFile<ELFT>> _hexagonRuntimeFile;
+ HexagonTargetLayout<ELFT> &_targetLayout;
+ std::unique_ptr<HexagonRuntimeFile<ELFT>> _runtimeFile;
};
template <class ELFT>
HexagonExecutableWriter<ELFT>::HexagonExecutableWriter(
HexagonLinkingContext &ctx, HexagonTargetLayout<ELFT> &layout)
- : ExecutableWriter<ELFT>(ctx, layout), _ctx(ctx),
- _hexagonTargetLayout(layout),
- _hexagonRuntimeFile(new HexagonRuntimeFile<ELFT>(ctx)) {}
+ : ExecutableWriter<ELFT>(ctx, layout), _ctx(ctx), _targetLayout(layout),
+ _runtimeFile(new HexagonRuntimeFile<ELFT>(ctx)) {}
template <class ELFT>
bool HexagonExecutableWriter<ELFT>::createImplicitFiles(
@@ -63,7 +62,7 @@ bool HexagonExecutableWriter<ELFT>::crea
ExecutableWriter<ELFT>::createImplicitFiles(result);
// Add the default atoms as defined for hexagon
addDefaultAtoms();
- result.push_back(std::move(_hexagonRuntimeFile));
+ result.push_back(std::move(_runtimeFile));
return true;
}
@@ -71,11 +70,11 @@ template <class ELFT>
void HexagonExecutableWriter<ELFT>::finalizeDefaultAtomValues() {
// Finalize the atom values that are part of the parent.
ExecutableWriter<ELFT>::finalizeDefaultAtomValues();
- auto sdabaseAtomIter = _hexagonTargetLayout.findAbsoluteAtom("_SDA_BASE_");
+ auto sdabaseAtomIter = _targetLayout.findAbsoluteAtom("_SDA_BASE_");
(*sdabaseAtomIter)->_virtualAddr =
- _hexagonTargetLayout.getSDataSection()->virtualAddr();
+ _targetLayout.getSDataSection()->virtualAddr();
if (_ctx.isDynamic())
- finalizeHexagonRuntimeAtomValues(_hexagonTargetLayout);
+ finalizeHexagonRuntimeAtomValues(_targetLayout);
}
} // namespace elf
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=233746&r1=233745&r2=233746&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.cpp Tue Mar 31 15:29:08 2015
@@ -262,19 +262,19 @@ std::error_code HexagonTargetRelocationH
break;
case R_HEX_GPREL16_0:
relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getSDataSection()->virtualAddr(), 0);
+ _targetLayout.getSDataSection()->virtualAddr(), 0);
break;
case R_HEX_GPREL16_1:
relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getSDataSection()->virtualAddr(), 1);
+ _targetLayout.getSDataSection()->virtualAddr(), 1);
break;
case R_HEX_GPREL16_2:
relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getSDataSection()->virtualAddr(), 2);
+ _targetLayout.getSDataSection()->virtualAddr(), 2);
break;
case R_HEX_GPREL16_3:
relocHexGPRELN(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getSDataSection()->virtualAddr(), 3);
+ _targetLayout.getSDataSection()->virtualAddr(), 3);
break;
case R_HEX_16_X:
case R_HEX_12_X:
@@ -294,52 +294,45 @@ std::error_code HexagonTargetRelocationH
break;
case R_HEX_GOTREL_32:
relocHexGOTREL_32(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getGOTSymAddr());
+ _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOTREL_LO16:
relocHexGOTREL_HILO16(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getGOTSymAddr());
+ _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOTREL_HI16:
relocHexGOTREL_HILO16(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getGOTSymAddr(), 16);
+ _targetLayout.getGOTSymAddr(), 16);
break;
case R_HEX_GOT_LO16:
- relocHexGOTLO16(location, targetVAddress,
- _hexagonTargetLayout.getGOTSymAddr());
+ relocHexGOTLO16(location, targetVAddress, _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOT_HI16:
- relocHexGOTHI16(location, targetVAddress,
- _hexagonTargetLayout.getGOTSymAddr());
+ relocHexGOTHI16(location, targetVAddress, _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOT_32:
- relocHexGOT32(location, targetVAddress,
- _hexagonTargetLayout.getGOTSymAddr());
+ relocHexGOT32(location, targetVAddress, _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOT_16:
- relocHexGOT16(location, targetVAddress,
- _hexagonTargetLayout.getGOTSymAddr());
+ relocHexGOT16(location, targetVAddress, _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOT_32_6_X:
- relocHexGOT32_6_X(location, targetVAddress,
- _hexagonTargetLayout.getGOTSymAddr());
+ relocHexGOT32_6_X(location, targetVAddress, _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOT_16_X:
- relocHexGOT16_X(location, targetVAddress,
- _hexagonTargetLayout.getGOTSymAddr());
+ relocHexGOT16_X(location, targetVAddress, _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOT_11_X:
- relocHexGOT11_X(location, targetVAddress,
- _hexagonTargetLayout.getGOTSymAddr());
+ relocHexGOT11_X(location, targetVAddress, _targetLayout.getGOTSymAddr());
break;
case R_HEX_GOTREL_32_6_X:
relocHexGOTRELSigned(location, relocVAddress, targetVAddress, ref.addend(),
- _hexagonTargetLayout.getGOTSymAddr(), 6);
+ _targetLayout.getGOTSymAddr(), 6);
break;
case R_HEX_GOTREL_16_X:
case R_HEX_GOTREL_11_X:
relocHexGOTRELUnsigned(location, relocVAddress, targetVAddress,
- ref.addend(), _hexagonTargetLayout.getGOTSymAddr());
+ ref.addend(), _targetLayout.getGOTSymAddr());
break;
default:
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=233746&r1=233745&r2=233746&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h Tue Mar 31 15:29:08 2015
@@ -21,14 +21,14 @@ class HexagonTargetHandler;
class HexagonTargetRelocationHandler final : public TargetRelocationHandler {
public:
HexagonTargetRelocationHandler(HexagonTargetLayout<HexagonELFType> &layout)
- : _hexagonTargetLayout(layout) {}
+ : _targetLayout(layout) {}
std::error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
const lld::AtomLayout &,
const Reference &) const override;
private:
- HexagonTargetLayout<HexagonELFType> &_hexagonTargetLayout;
+ HexagonTargetLayout<HexagonELFType> &_targetLayout;
};
} // elf
} // lld
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=233746&r1=233745&r2=233746&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Tue Mar 31 15:29:08 2015
@@ -19,20 +19,18 @@ using namespace llvm::ELF;
using llvm::makeArrayRef;
HexagonTargetHandler::HexagonTargetHandler(HexagonLinkingContext &ctx)
- : _ctx(ctx),
- _hexagonRuntimeFile(new HexagonRuntimeFile<HexagonELFType>(ctx)),
- _hexagonTargetLayout(new HexagonTargetLayout<HexagonELFType>(ctx)),
- _hexagonRelocationHandler(
- new HexagonTargetRelocationHandler(*_hexagonTargetLayout)) {}
+ : _ctx(ctx), _runtimeFile(new HexagonRuntimeFile<HexagonELFType>(ctx)),
+ _targetLayout(new HexagonTargetLayout<HexagonELFType>(ctx)),
+ _relocationHandler(new HexagonTargetRelocationHandler(*_targetLayout)) {}
std::unique_ptr<Writer> HexagonTargetHandler::getWriter() {
switch (_ctx.getOutputELFType()) {
case llvm::ELF::ET_EXEC:
return llvm::make_unique<HexagonExecutableWriter<HexagonELFType>>(
- _ctx, *_hexagonTargetLayout.get());
+ _ctx, *_targetLayout.get());
case llvm::ELF::ET_DYN:
return llvm::make_unique<HexagonDynamicLibraryWriter<HexagonELFType>>(
- _ctx, *_hexagonTargetLayout.get());
+ _ctx, *_targetLayout.get());
case llvm::ELF::ET_REL:
llvm_unreachable("TODO: support -r mode");
default:
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=233746&r1=233745&r2=233746&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.h Tue Mar 31 15:29:08 2015
@@ -110,11 +110,11 @@ public:
void registerRelocationNames(Registry ®istry) override;
const HexagonTargetRelocationHandler &getRelocationHandler() const override {
- return *_hexagonRelocationHandler;
+ return *_relocationHandler;
}
HexagonTargetLayout<HexagonELFType> &getTargetLayout() override {
- return *_hexagonTargetLayout;
+ return *_targetLayout;
}
std::unique_ptr<Reader> getObjReader() override {
@@ -131,9 +131,9 @@ private:
llvm::BumpPtrAllocator _alloc;
static const Registry::KindStrings kindStrings[];
HexagonLinkingContext &_ctx;
- std::unique_ptr<HexagonRuntimeFile<HexagonELFType> > _hexagonRuntimeFile;
- std::unique_ptr<HexagonTargetLayout<HexagonELFType>> _hexagonTargetLayout;
- std::unique_ptr<HexagonTargetRelocationHandler> _hexagonRelocationHandler;
+ std::unique_ptr<HexagonRuntimeFile<HexagonELFType>> _runtimeFile;
+ std::unique_ptr<HexagonTargetLayout<HexagonELFType>> _targetLayout;
+ std::unique_ptr<HexagonTargetRelocationHandler> _relocationHandler;
};
template <class ELFT>
More information about the llvm-commits
mailing list