<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 26, 2015 at 8:44 PM, Craig Topper via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ctopper<br>
Date: Sat Sep 26 22:44:08 2015<br>
New Revision: 248678<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=248678&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=248678&view=rev</a><br>
Log:<br>
Use llvm::makeArrayRef. NFC.<br>
<br>
Modified:<br>
cfe/trunk/include/clang/AST/Type.h<br>
cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h<br>
cfe/trunk/lib/AST/ASTImporter.cpp<br>
cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/Type.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=248678&r1=248677&r2=248678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=248678&r1=248677&r2=248678&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/Type.h (original)<br>
+++ cfe/trunk/include/clang/AST/Type.h Sat Sep 26 22:44:08 2015<br>
@@ -4635,7 +4635,7 @@ public:<br>
/// Retrieve the type arguments of this object type as they were<br>
/// written.<br>
ArrayRef<QualType> getTypeArgsAsWritten() const {<br>
- return ArrayRef<QualType>(getTypeArgStorage(),<br>
+ return llvm::makeArrayRef(getTypeArgStorage(),<br>
ObjCObjectTypeBits.NumTypeArgs);<br>
}<br>
<br>
<br>
Modified: cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h?rev=248678&r1=248677&r2=248678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h?rev=248678&r1=248677&r2=248678&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h (original)<br>
+++ cfe/trunk/include/clang/Analysis/Analyses/ThreadSafetyTIL.h Sat Sep 26 22:44:08 2015<br>
@@ -1395,7 +1395,7 @@ public:<br>
<br>
/// Return the list of basic blocks that this terminator can branch to.<br>
ArrayRef<BasicBlock*> successors() {<br>
- return ArrayRef<BasicBlock*>(&TargetBlock, 1);<br>
+ return llvm::makeArrayRef(TargetBlock);<br></blockquote><div><br></div><div>I think this one might work even without makeArrayRef? (there's an implicit ctor in ArrayRef<T> from T)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
}<br>
<br>
template <class V><br>
@@ -1445,7 +1445,7 @@ public:<br>
<br>
/// Return the list of basic blocks that this terminator can branch to.<br>
ArrayRef<BasicBlock*> successors() {<br>
- return ArrayRef<BasicBlock*>(Branches, 2);<br>
+ return llvm::makeArrayRef(Branches);<br>
}<br>
<br>
template <class V><br>
<br>
Modified: cfe/trunk/lib/AST/ASTImporter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=248678&r1=248677&r2=248678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=248678&r1=248677&r2=248678&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTImporter.cpp Sat Sep 26 22:44:08 2015<br>
@@ -5329,7 +5329,7 @@ Expr *ASTNodeImporter::VisitCallExpr(Cal<br>
<br>
return new (Importer.getToContext())<br>
CallExpr(Importer.getToContext(), ToCallee,<br>
- ArrayRef<Expr*>(ToArgs_Copied, NumArgs), T, E->getValueKind(),<br>
+ llvm::makeArrayRef(ToArgs_Copied, NumArgs), T, E->getValueKind(),<br>
Importer.Import(E->getRParenLoc()));<br>
}<br>
<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=248678&r1=248677&r2=248678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=248678&r1=248677&r2=248678&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sat Sep 26 22:44:08 2015<br>
@@ -2825,7 +2825,7 @@ CodeGenModule::GetAddrOfConstantCFString<br>
// String pointer.<br>
llvm::Constant *C = nullptr;<br>
if (isUTF16) {<br>
- ArrayRef<uint16_t> Arr = llvm::makeArrayRef<uint16_t>(<br>
+ auto Arr = llvm::makeArrayRef(<br>
reinterpret_cast<uint16_t *>(const_cast<char *>(Entry.first().data())),<br>
Entry.first().size() / 2);<br>
C = llvm::ConstantDataArray::get(VMContext, Arr);<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=248678&r1=248677&r2=248678&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=248678&r1=248677&r2=248678&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Sat Sep 26 22:44:08 2015<br>
@@ -208,7 +208,7 @@ namespace clang {<br>
auto &&PartialSpecializations = getPartialSpecializations(Common);<br>
ArrayRef<DeclID> LazySpecializations;<br>
if (auto *LS = Common->LazySpecializations)<br>
- LazySpecializations = ArrayRef<DeclID>(LS + 1, LS + 1 + LS[0]);<br>
+ LazySpecializations = llvm::makeArrayRef(LS + 1, LS + 1 + LS[0]);<br></blockquote><div><br></div><div>Maybe you could use LS[0] as the second arg (for a ptr+length rather than begin+end construction)?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
// Add a slot to the record for the number of specializations.<br>
unsigned I = Record.size();<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>