[lld] r196475 - Remove makeArrayRef() calls.
Rui Ueyama
ruiu at google.com
Wed Dec 4 22:55:26 PST 2013
Author: ruiu
Date: Thu Dec 5 00:55:26 2013
New Revision: 196475
URL: http://llvm.org/viewvc/llvm-project?rev=196475&view=rev
Log:
Remove makeArrayRef() calls.
Because ArrayRef has implicit conversion from C arrays, we don't need
makeArrayRef.
Modified:
lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp
lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp
Modified: lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h?rev=196475&r1=196474&r2=196475&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h (original)
+++ lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h Thu Dec 5 00:55:26 2013
@@ -46,7 +46,7 @@ public:
_createManifest(true), _embedManifest(false), _manifestId(1),
_manifestLevel("'asInvoker'"), _manifestUiAccess("'false'"),
_imageType(ImageType::IMAGE_EXE),
- _dosStub(llvm::makeArrayRef(DEFAULT_DOS_STUB)) {
+ _dosStub(DEFAULT_DOS_STUB) {
setDeadStripping(true);
}
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=196475&r1=196474&r2=196475&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Thu Dec 5 00:55:26 2013
@@ -14,8 +14,6 @@ using namespace lld;
using namespace elf;
using namespace llvm::ELF;
-using llvm::makeArrayRef;
-
HexagonTargetHandler::HexagonTargetHandler(HexagonLinkingContext &context)
: DefaultTargetHandler(context), _targetLayout(context),
_relocationHandler(context, *this, _targetLayout),
@@ -55,7 +53,7 @@ public:
HexagonGOTAtom(const File &f) : GOTAtom(f, ".got") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return makeArrayRef(hexagonGotAtomContent);
+ return hexagonGotAtomContent;
}
virtual Alignment alignment() const { return Alignment(2); }
@@ -66,7 +64,7 @@ public:
HexagonGOTPLTAtom(const File &f) : GOTAtom(f, ".got.plt") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return makeArrayRef(hexagonGotPltAtomContent);
+ return hexagonGotPltAtomContent;
}
virtual Alignment alignment() const { return Alignment(2); }
@@ -77,7 +75,7 @@ public:
HexagonGOTPLT0Atom(const File &f) : GOTAtom(f, ".got.plt") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return makeArrayRef(hexagonGotPlt0AtomContent);
+ return hexagonGotPlt0AtomContent;
}
virtual Alignment alignment() const { return Alignment(3); }
@@ -92,7 +90,7 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- return makeArrayRef(hexagonPlt0AtomContent);
+ return hexagonPlt0AtomContent;
}
};
@@ -102,7 +100,7 @@ public:
HexagonPLTAtom(const File &f, StringRef secName) : PLTAtom(f, secName) {}
virtual ArrayRef<uint8_t> rawContent() const {
- return makeArrayRef(hexagonPltAtomContent);
+ return hexagonPltAtomContent;
}
};
Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp?rev=196475&r1=196474&r2=196475&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp Thu Dec 5 00:55:26 2013
@@ -21,8 +21,6 @@
using namespace lld;
using namespace lld::elf;
-using llvm::makeArrayRef;
-
namespace {
using namespace llvm::ELF;
@@ -39,7 +37,7 @@ public:
#endif
}
virtual ArrayRef<uint8_t> rawContent() const {
- return makeArrayRef(x86_64InitFiniAtomContent);
+ return x86_64InitFiniAtomContent;
}
virtual Alignment alignment() const { return Alignment(3); }
};
@@ -53,8 +51,9 @@ public:
_name += function;
#endif
}
+
virtual ArrayRef<uint8_t> rawContent() const {
- return makeArrayRef(x86_64InitFiniAtomContent);
+ return x86_64InitFiniAtomContent;
}
virtual Alignment alignment() const { return Alignment(3); }
Modified: lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp?rev=196475&r1=196474&r2=196475&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86.hpp Thu Dec 5 00:55:26 2013
@@ -19,8 +19,6 @@
#include "ReferenceKinds.h"
-using llvm::makeArrayRef;
-
namespace lld {
namespace mach_o {
@@ -50,7 +48,7 @@ public:
static const uint8_t instructions[] =
{ 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00 }; // jmp *lazyPointer
assert(sizeof(instructions) == this->size());
- return makeArrayRef(instructions);
+ return instructions;
}
};
@@ -85,7 +83,7 @@ public:
0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *_fast_lazy_bind
0x90 }; // nop
assert(sizeof(instructions) == this->size());
- return makeArrayRef(instructions);
+ return instructions;
}
};
@@ -118,7 +116,7 @@ public:
{ 0x68, 0x00, 0x00, 0x00, 0x00, // pushq $lazy-info-offset
0xE9, 0x00, 0x00, 0x00, 0x00 }; // jmp helperhelper
assert(sizeof(instructions) == this->size());
- return makeArrayRef(instructions);
+ return instructions;
}
};
@@ -152,7 +150,7 @@ public:
virtual ArrayRef<uint8_t> rawContent() const {
static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x00 };
- return makeArrayRef(bytes);
+ return bytes;
}
};
@@ -187,8 +185,8 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x0 };
- return makeArrayRef(bytes);
+ static const uint8_t bytes[] = { 0x00, 0x00, 0x00, 0x00 };
+ return bytes;
}
};
Modified: lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp?rev=196475&r1=196474&r2=196475&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubAtoms_x86_64.hpp Thu Dec 5 00:55:26 2013
@@ -19,8 +19,6 @@
#include "ReferenceKinds.h"
-using llvm::makeArrayRef;
-
namespace lld {
namespace mach_o {
@@ -47,10 +45,9 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t instructions[] =
- { 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00 }; // jmp *lazyPointer
+ static const uint8_t instructions[6] = { 0xFF, 0x25 }; // jmp *lazyPointer
assert(sizeof(instructions) == this->size());
- return makeArrayRef(instructions);
+ return instructions;
}
};
@@ -85,7 +82,7 @@ public:
0xFF, 0x25, 0x00, 0x00, 0x00, 0x00, // jmp *binder(%rip)
0x90 }; // nop
assert(sizeof(instructions) == this->size());
- return makeArrayRef(instructions);
+ return instructions;
}
};
@@ -117,7 +114,7 @@ public:
{ 0x68, 0x00, 0x00, 0x00, 0x00, // pushq $lazy-info-offset
0xE9, 0x00, 0x00, 0x00, 0x00 }; // jmp helperhelper
assert(sizeof(instructions) == this->size());
- return makeArrayRef(instructions);
+ return instructions;
}
};
@@ -150,9 +147,8 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t bytes[] =
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- return makeArrayRef(bytes);
+ static const uint8_t bytes[8] = {};
+ return bytes;
}
};
@@ -186,9 +182,8 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- static const uint8_t bytes[] =
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- return makeArrayRef(bytes);
+ static const uint8_t bytes[8] = {};
+ return bytes;
}
};
More information about the llvm-commits
mailing list