From d430f733ee196bb474e6b1b188de21c9c942e184 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 27 Sep 2015 03:44:08 +0000 Subject: [PATCH] Use llvm::makeArrayRef. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248678 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Type.h | 2 +- include/clang/Analysis/Analyses/ThreadSafetyTIL.h | 4 ++-- lib/AST/ASTImporter.cpp | 2 +- lib/CodeGen/CodeGenModule.cpp | 2 +- lib/Serialization/ASTWriterDecl.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 075fe87dab..c548fd3d04 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -4635,7 +4635,7 @@ public: /// Retrieve the type arguments of this object type as they were /// written. ArrayRef getTypeArgsAsWritten() const { - return ArrayRef(getTypeArgStorage(), + return llvm::makeArrayRef(getTypeArgStorage(), ObjCObjectTypeBits.NumTypeArgs); } diff --git a/include/clang/Analysis/Analyses/ThreadSafetyTIL.h b/include/clang/Analysis/Analyses/ThreadSafetyTIL.h index 9f3bbdb8e5..e4b8d478d7 100644 --- a/include/clang/Analysis/Analyses/ThreadSafetyTIL.h +++ b/include/clang/Analysis/Analyses/ThreadSafetyTIL.h @@ -1395,7 +1395,7 @@ public: /// Return the list of basic blocks that this terminator can branch to. ArrayRef successors() { - return ArrayRef(&TargetBlock, 1); + return llvm::makeArrayRef(TargetBlock); } template @@ -1445,7 +1445,7 @@ public: /// Return the list of basic blocks that this terminator can branch to. ArrayRef successors() { - return ArrayRef(Branches, 2); + return llvm::makeArrayRef(Branches); } template diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index c26bf30705..6816dd11d9 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -5329,7 +5329,7 @@ Expr *ASTNodeImporter::VisitCallExpr(CallExpr *E) { return new (Importer.getToContext()) CallExpr(Importer.getToContext(), ToCallee, - ArrayRef(ToArgs_Copied, NumArgs), T, E->getValueKind(), + llvm::makeArrayRef(ToArgs_Copied, NumArgs), T, E->getValueKind(), Importer.Import(E->getRParenLoc())); } diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 954fdab567..647cf0bd6a 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2825,7 +2825,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { // String pointer. llvm::Constant *C = nullptr; if (isUTF16) { - ArrayRef Arr = llvm::makeArrayRef( + auto Arr = llvm::makeArrayRef( reinterpret_cast(const_cast(Entry.first().data())), Entry.first().size() / 2); C = llvm::ConstantDataArray::get(VMContext, Arr); diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 6b51a761a8..7a54f5a03b 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -208,7 +208,7 @@ namespace clang { auto &&PartialSpecializations = getPartialSpecializations(Common); ArrayRef LazySpecializations; if (auto *LS = Common->LazySpecializations) - LazySpecializations = ArrayRef(LS + 1, LS + 1 + LS[0]); + LazySpecializations = llvm::makeArrayRef(LS + 1, LS + 1 + LS[0]); // Add a slot to the record for the number of specializations. unsigned I = Record.size(); -- 2.40.0