aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objcopy/ELF/Object.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-06-22 09:19:48 -0700
committerFangrui Song <i@maskray.me>2021-06-22 09:19:48 -0700
commit3accff2553c00c3237876edd6066e1701c52e66c (patch)
tree6c3f14efc59fbe8df298f74b5e0afa3f6d2675b5 /llvm/tools/llvm-objcopy/ELF/Object.cpp
parentdd1b121c99de6bd7186e23e2bf34edb02db7c076 (diff)
downloadllvm-3accff2553c00c3237876edd6066e1701c52e66c.zip
llvm-3accff2553c00c3237876edd6066e1701c52e66c.tar.gz
llvm-3accff2553c00c3237876edd6066e1701c52e66c.tar.bz2
[llvm-objcopy] Fix some namespace style issues
https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D104693
Diffstat (limited to 'llvm/tools/llvm-objcopy/ELF/Object.cpp')
-rw-r--r--llvm/tools/llvm-objcopy/ELF/Object.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/llvm/tools/llvm-objcopy/ELF/Object.cpp b/llvm/tools/llvm-objcopy/ELF/Object.cpp
index 5f1b4c3..0255fda 100644
--- a/llvm/tools/llvm-objcopy/ELF/Object.cpp
+++ b/llvm/tools/llvm-objcopy/ELF/Object.cpp
@@ -29,12 +29,10 @@
#include <utility>
#include <vector>
-namespace llvm {
-namespace objcopy {
-namespace elf {
-
-using namespace object;
-using namespace ELF;
+using namespace llvm;
+using namespace llvm::ELF;
+using namespace llvm::objcopy::elf;
+using namespace llvm::object;
template <class ELFT> void ELFWriter<ELFT>::writePhdr(const Segment &Seg) {
uint8_t *B = reinterpret_cast<uint8_t *>(Buf->getBufferStart()) +
@@ -192,7 +190,7 @@ template <class T> static T checkedGetHex(StringRef S) {
// Fills exactly Len bytes of buffer with hexadecimal characters
// representing value 'X'
template <class T, class Iterator>
-static Iterator utohexstr(T X, Iterator It, size_t Len) {
+static Iterator toHexStr(T X, Iterator It, size_t Len) {
// Fill range with '0'
std::fill(It, It + Len, '0');
@@ -221,13 +219,13 @@ IHexLineData IHexRecord::getLine(uint8_t Type, uint16_t Addr,
assert(Line.size());
auto Iter = Line.begin();
*Iter++ = ':';
- Iter = utohexstr(Data.size(), Iter, 2);
- Iter = utohexstr(Addr, Iter, 4);
- Iter = utohexstr(Type, Iter, 2);
+ Iter = toHexStr(Data.size(), Iter, 2);
+ Iter = toHexStr(Addr, Iter, 4);
+ Iter = toHexStr(Type, Iter, 2);
for (uint8_t X : Data)
- Iter = utohexstr(X, Iter, 2);
+ Iter = toHexStr(X, Iter, 2);
StringRef S(Line.data() + 1, std::distance(Line.begin() + 1, Iter));
- Iter = utohexstr(getChecksum(S), Iter, 2);
+ Iter = toHexStr(getChecksum(S), Iter, 2);
*Iter++ = '\r';
*Iter++ = '\n';
assert(Iter == Line.end());
@@ -2706,6 +2704,10 @@ Error IHexWriter::finalize() {
return Error::success();
}
+namespace llvm {
+namespace objcopy {
+namespace elf {
+
template class ELFBuilder<ELF64LE>;
template class ELFBuilder<ELF64BE>;
template class ELFBuilder<ELF32LE>;