<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Dec 4, 2013 at 10:18 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On Wed, Dec 4, 2013 at 8:41 PM, Rui Ueyama <<a href="mailto:ruiu@google.com">ruiu@google.com</a>> wrote:<br>
> Author: ruiu<br>
> Date: Wed Dec 4 22:41:10 2013<br>
> New Revision: 196465<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=196465&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=196465&view=rev</a><br>
> Log:<br>
> Use makeArrayRef to construct ArrayRefs from C arrays.<br>
<br>
</div>ArrayRef does have implicit conversion from arrays (<br>
<a href="http://llvm.org/docs/doxygen/html/classllvm_1_1ArrayRef.html#aef393d65e1deaf4cc754849a16f6a163" target="_blank">http://llvm.org/docs/doxygen/html/classllvm_1_1ArrayRef.html#aef393d65e1deaf4cc754849a16f6a163</a><br>
) so you might not even need makeArrayRef in some (all?) of these<br>
cases. ma</blockquote><div><br></div><div>Good point. We don't need makeArrayRef in all of these cases. Fixed in r196475.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">
><br>
> Modified:<br>
> lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp<br>
> lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp<br>
><br>
> Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=196465&r1=196464&r2=196465&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=196465&r1=196464&r2=196465&view=diff</a><br>
> ==============================================================================<br>
> --- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)<br>
> +++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Wed Dec 4 22:41:10 2013<br>
> @@ -12,9 +12,10 @@<br>
><br>
> using namespace lld;<br>
> using namespace elf;<br>
> -<br>
> using namespace llvm::ELF;<br>
><br>
> +using llvm::makeArrayRef;<br>
> +<br>
> HexagonTargetHandler::HexagonTargetHandler(HexagonLinkingContext &context)<br>
> : DefaultTargetHandler(context), _targetLayout(context),<br>
> _relocationHandler(context, *this, _targetLayout),<br>
> @@ -54,7 +55,7 @@ public:<br>
> HexagonGOTAtom(const File &f) : GOTAtom(f, ".got") {}<br>
><br>
> virtual ArrayRef<uint8_t> rawContent() const {<br>
> - return ArrayRef<uint8_t>(hexagonGotAtomContent, 4);<br>
> + return makeArrayRef(hexagonGotAtomContent);<br>
> }<br>
><br>
> virtual Alignment alignment() const { return Alignment(2); }<br>
> @@ -65,7 +66,7 @@ public:<br>
> HexagonGOTPLTAtom(const File &f) : GOTAtom(f, ".got.plt") {}<br>
><br>
> virtual ArrayRef<uint8_t> rawContent() const {<br>
> - return ArrayRef<uint8_t>(hexagonGotPltAtomContent, 4);<br>
> + return makeArrayRef(hexagonGotPltAtomContent);<br>
> }<br>
><br>
> virtual Alignment alignment() const { return Alignment(2); }<br>
> @@ -76,7 +77,7 @@ public:<br>
> HexagonGOTPLT0Atom(const File &f) : GOTAtom(f, ".got.plt") {}<br>
><br>
> virtual ArrayRef<uint8_t> rawContent() const {<br>
> - return ArrayRef<uint8_t>(hexagonGotPlt0AtomContent, 16);<br>
> + return makeArrayRef(hexagonGotPlt0AtomContent);<br>
> }<br>
><br>
> virtual Alignment alignment() const { return Alignment(3); }<br>
> @@ -91,7 +92,7 @@ public:<br>
> }<br>
><br>
> virtual ArrayRef<uint8_t> rawContent() const {<br>
> - return ArrayRef<uint8_t>(hexagonPlt0AtomContent, 28);<br>
> + return makeArrayRef(hexagonPlt0AtomContent);<br>
> }<br>
> };<br>
><br>
> @@ -101,7 +102,7 @@ public:<br>
> HexagonPLTAtom(const File &f, StringRef secName) : PLTAtom(f, secName) {}<br>
><br>
> virtual ArrayRef<uint8_t> rawContent() const {<br>
> - return ArrayRef<uint8_t>(hexagonPltAtomContent, 16);<br>
> + return makeArrayRef(hexagonPltAtomContent);<br>
> }<br>
> };<br>
><br>
><br>
> Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp?rev=196465&r1=196464&r2=196465&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp?rev=196465&r1=196464&r2=196465&view=diff</a><br>
> ==============================================================================<br>
> --- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp (original)<br>
> +++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64LinkingContext.cpp Wed Dec 4 22:41:10 2013<br>
> @@ -21,6 +21,8 @@<br>
> using namespace lld;<br>
> using namespace lld::elf;<br>
><br>
> +using llvm::makeArrayRef;<br>
> +<br>
> namespace {<br>
> using namespace llvm::ELF;<br>
><br>
> @@ -37,7 +39,7 @@ public:<br>
> #endif<br>
> }<br>
> virtual ArrayRef<uint8_t> rawContent() const {<br>
> - return ArrayRef<uint8_t>(x86_64InitFiniAtomContent, 8);<br>
> + return makeArrayRef(x86_64InitFiniAtomContent);<br>
> }<br>
> virtual Alignment alignment() const { return Alignment(3); }<br>
> };<br>
> @@ -52,7 +54,7 @@ public:<br>
> #endif<br>
> }<br>
> virtual ArrayRef<uint8_t> rawContent() const {<br>
> - return ArrayRef<uint8_t>(x86_64InitFiniAtomContent, 8);<br>
> + return makeArrayRef(x86_64InitFiniAtomContent);<br>
> }<br>
><br>
> virtual Alignment alignment() const { return Alignment(3); }<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>