[lld] r196465 - Use makeArrayRef to construct ArrayRefs from C arrays.
Rui Ueyama
ruiu at google.com
Wed Dec 4 20:41:10 PST 2013
Author: ruiu
Date: Wed Dec 4 22:41:10 2013
New Revision: 196465
URL: http://llvm.org/viewvc/llvm-project?rev=196465&view=rev
Log:
Use makeArrayRef to construct ArrayRefs from C arrays.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp
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=196465&r1=196464&r2=196465&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Wed Dec 4 22:41:10 2013
@@ -12,9 +12,10 @@
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),
@@ -54,7 +55,7 @@ public:
HexagonGOTAtom(const File &f) : GOTAtom(f, ".got") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return ArrayRef<uint8_t>(hexagonGotAtomContent, 4);
+ return makeArrayRef(hexagonGotAtomContent);
}
virtual Alignment alignment() const { return Alignment(2); }
@@ -65,7 +66,7 @@ public:
HexagonGOTPLTAtom(const File &f) : GOTAtom(f, ".got.plt") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return ArrayRef<uint8_t>(hexagonGotPltAtomContent, 4);
+ return makeArrayRef(hexagonGotPltAtomContent);
}
virtual Alignment alignment() const { return Alignment(2); }
@@ -76,7 +77,7 @@ public:
HexagonGOTPLT0Atom(const File &f) : GOTAtom(f, ".got.plt") {}
virtual ArrayRef<uint8_t> rawContent() const {
- return ArrayRef<uint8_t>(hexagonGotPlt0AtomContent, 16);
+ return makeArrayRef(hexagonGotPlt0AtomContent);
}
virtual Alignment alignment() const { return Alignment(3); }
@@ -91,7 +92,7 @@ public:
}
virtual ArrayRef<uint8_t> rawContent() const {
- return ArrayRef<uint8_t>(hexagonPlt0AtomContent, 28);
+ return makeArrayRef(hexagonPlt0AtomContent);
}
};
@@ -101,7 +102,7 @@ public:
HexagonPLTAtom(const File &f, StringRef secName) : PLTAtom(f, secName) {}
virtual ArrayRef<uint8_t> rawContent() const {
- return ArrayRef<uint8_t>(hexagonPltAtomContent, 16);
+ return makeArrayRef(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=196465&r1=196464&r2=196465&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp Wed Dec 4 22:41:10 2013
@@ -21,6 +21,8 @@
using namespace lld;
using namespace lld::elf;
+using llvm::makeArrayRef;
+
namespace {
using namespace llvm::ELF;
@@ -37,7 +39,7 @@ public:
#endif
}
virtual ArrayRef<uint8_t> rawContent() const {
- return ArrayRef<uint8_t>(x86_64InitFiniAtomContent, 8);
+ return makeArrayRef(x86_64InitFiniAtomContent);
}
virtual Alignment alignment() const { return Alignment(3); }
};
@@ -52,7 +54,7 @@ public:
#endif
}
virtual ArrayRef<uint8_t> rawContent() const {
- return ArrayRef<uint8_t>(x86_64InitFiniAtomContent, 8);
+ return makeArrayRef(x86_64InitFiniAtomContent);
}
virtual Alignment alignment() const { return Alignment(3); }
More information about the llvm-commits
mailing list