<div dir="ltr">Sure.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 29, 2016 at 6:34 AM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="rtl"><div dir="ltr">Hi David,</div><div dir="ltr"><br></div><div dir="ltr">CapturedDecl::params() was removed here.</div><div dir="ltr">Does it make sense to provide instead ArrayRef<ImplicitParamDecl *> CapturedDecl::parameters() ?<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div dir="ltr"><br></div><div dir="ltr">Yaron</div><div dir="ltr"><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2016-06-24 7:05 GMT+03:00 David Majnemer via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: majnemer<br>
Date: Thu Jun 23 23:05:48 2016<br>
New Revision: 273647<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=273647&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=273647&view=rev</a><br>
Log:<br>
Use more ArrayRefs<br>
<br>
No functional change is intended, just a small refactoring.<br>
<br>
Modified:<br>
cfe/trunk/include/clang/AST/Decl.h<br>
cfe/trunk/include/clang/AST/DeclObjC.h<br>
cfe/trunk/include/clang/Sema/Sema.h<br>
cfe/trunk/lib/AST/ASTContext.cpp<br>
cfe/trunk/lib/AST/ASTDumper.cpp<br>
cfe/trunk/lib/AST/ASTImporter.cpp<br>
cfe/trunk/lib/AST/Comment.cpp<br>
cfe/trunk/lib/AST/Decl.cpp<br>
cfe/trunk/lib/AST/DeclPrinter.cpp<br>
cfe/trunk/lib/AST/StmtPrinter.cpp<br>
cfe/trunk/lib/Analysis/Consumed.cpp<br>
cfe/trunk/lib/CodeGen/CGCall.cpp<br>
cfe/trunk/lib/CodeGen/CGClass.cpp<br>
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
cfe/trunk/lib/CodeGen/CGObjCMac.cpp<br>
cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp<br>
cfe/trunk/lib/CodeGen/CGVTables.cpp<br>
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp<br>
cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp<br>
cfe/trunk/lib/Frontend/ASTConsumers.cpp<br>
cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp<br>
cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp<br>
cfe/trunk/lib/Index/IndexDecl.cpp<br>
cfe/trunk/lib/Index/USRGeneration.cpp<br>
cfe/trunk/lib/Sema/SemaChecking.cpp<br>
cfe/trunk/lib/Sema/SemaCodeComplete.cpp<br>
cfe/trunk/lib/Sema/SemaDecl.cpp<br>
cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>
cfe/trunk/lib/Sema/SemaExpr.cpp<br>
cfe/trunk/lib/Sema/SemaLambda.cpp<br>
cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp<br>
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp<br>
cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp<br>
cfe/trunk/lib/Sema/TreeTransform.h<br>
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>
cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp<br>
cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp<br>
cfe/trunk/tools/libclang/CIndex.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/Decl.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/Decl.h (original)<br>
+++ cfe/trunk/include/clang/AST/Decl.h Thu Jun 23 23:05:48 2016<br>
@@ -1952,29 +1952,24 @@ public:<br>
<br>
unsigned getBuiltinID() const;<br>
<br>
- // Iterator access to formal parameters.<br>
- unsigned param_size() const { return getNumParams(); }<br>
- typedef ParmVarDecl **param_iterator;<br>
- typedef ParmVarDecl * const *param_const_iterator;<br>
- typedef llvm::iterator_range<param_iterator> param_range;<br>
- typedef llvm::iterator_range<param_const_iterator> param_const_range;<br>
-<br>
- param_iterator param_begin() { return param_iterator(ParamInfo); }<br>
- param_iterator param_end() {<br>
- return param_iterator(ParamInfo + param_size());<br>
- }<br>
- param_range params() { return param_range(param_begin(), param_end()); }<br>
-<br>
- param_const_iterator param_begin() const {<br>
- return param_const_iterator(ParamInfo);<br>
- }<br>
- param_const_iterator param_end() const {<br>
- return param_const_iterator(ParamInfo + param_size());<br>
+ // ArrayRef interface to parameters.<br>
+ ArrayRef<ParmVarDecl *> parameters() const {<br>
+ return {ParamInfo, getNumParams()};<br>
}<br>
- param_const_range params() const {<br>
- return param_const_range(param_begin(), param_end());<br>
+ MutableArrayRef<ParmVarDecl *> parameters() {<br>
+ return {ParamInfo, getNumParams()};<br>
}<br>
<br>
+ // Iterator access to formal parameters.<br>
+ typedef MutableArrayRef<ParmVarDecl *>::iterator param_iterator;<br>
+ typedef ArrayRef<ParmVarDecl *>::const_iterator param_const_iterator;<br>
+ bool param_empty() const { return parameters().empty(); }<br>
+ param_iterator param_begin() { return parameters().begin(); }<br>
+ param_iterator param_end() { return parameters().end(); }<br>
+ param_const_iterator param_begin() const { return parameters().begin(); }<br>
+ param_const_iterator param_end() const { return parameters().end(); }<br>
+ size_t param_size() const { return parameters().size(); }<br>
+<br>
/// getNumParams - Return the number of parameters this function must have<br>
/// based on its FunctionType. This is the length of the ParamInfo array<br>
/// after it has been created.<br>
@@ -1992,12 +1987,6 @@ public:<br>
setParams(getASTContext(), NewParamInfo);<br>
}<br>
<br>
- // ArrayRef iterface to parameters.<br>
- // FIXME: Should one day replace iterator interface.<br>
- ArrayRef<ParmVarDecl*> parameters() const {<br>
- return llvm::makeArrayRef(ParamInfo, getNumParams());<br>
- }<br>
-<br>
ArrayRef<NamedDecl *> getDeclsInPrototypeScope() const {<br>
return DeclsInPrototypeScope;<br>
}<br>
@@ -2504,34 +2493,33 @@ class IndirectFieldDecl : public ValueDe<br>
<br>
IndirectFieldDecl(ASTContext &C, DeclContext *DC, SourceLocation L,<br>
DeclarationName N, QualType T,<br>
- NamedDecl **CH, unsigned CHS);<br>
+ MutableArrayRef<NamedDecl *> CH);<br>
<br>
public:<br>
static IndirectFieldDecl *Create(ASTContext &C, DeclContext *DC,<br>
SourceLocation L, IdentifierInfo *Id,<br>
- QualType T, NamedDecl **CH, unsigned CHS);<br>
+ QualType T, llvm::MutableArrayRef<NamedDecl *> CH);<br>
<br>
static IndirectFieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);<br>
-<br>
- typedef NamedDecl * const *chain_iterator;<br>
- typedef llvm::iterator_range<chain_iterator> chain_range;<br>
<br>
- chain_range chain() const { return chain_range(chain_begin(), chain_end()); }<br>
- chain_iterator chain_begin() const { return chain_iterator(Chaining); }<br>
- chain_iterator chain_end() const {<br>
- return chain_iterator(Chaining + ChainingSize);<br>
+ typedef ArrayRef<NamedDecl *>::const_iterator chain_iterator;<br>
+<br>
+ ArrayRef<NamedDecl *> chain() const {<br>
+ return llvm::makeArrayRef(Chaining, ChainingSize);<br>
}<br>
+ chain_iterator chain_begin() const { return chain().begin(); }<br>
+ chain_iterator chain_end() const { return chain().end(); }<br>
<br>
unsigned getChainingSize() const { return ChainingSize; }<br>
<br>
FieldDecl *getAnonField() const {<br>
- assert(ChainingSize >= 2);<br>
- return cast<FieldDecl>(Chaining[ChainingSize - 1]);<br>
+ assert(chain().size() >= 2);<br>
+ return cast<FieldDecl>(chain().back());<br>
}<br>
<br>
VarDecl *getVarDecl() const {<br>
- assert(ChainingSize >= 2);<br>
- return dyn_cast<VarDecl>(*chain_begin());<br>
+ assert(chain().size() >= 2);<br>
+ return dyn_cast<VarDecl>(chain().front());<br>
}<br>
<br>
IndirectFieldDecl *getCanonicalDecl() override { return getFirstDecl(); }<br>
@@ -3518,35 +3506,23 @@ public:<br>
void setSignatureAsWritten(TypeSourceInfo *Sig) { SignatureAsWritten = Sig; }<br>
TypeSourceInfo *getSignatureAsWritten() const { return SignatureAsWritten; }<br>
<br>
- // Iterator access to formal parameters.<br>
- unsigned param_size() const { return getNumParams(); }<br>
- typedef ParmVarDecl **param_iterator;<br>
- typedef ParmVarDecl * const *param_const_iterator;<br>
- typedef llvm::iterator_range<param_iterator> param_range;<br>
- typedef llvm::iterator_range<param_const_iterator> param_const_range;<br>
-<br>
// ArrayRef access to formal parameters.<br>
- // FIXME: Should eventual replace iterator access.<br>
- ArrayRef<ParmVarDecl*> parameters() const {<br>
- return llvm::makeArrayRef(ParamInfo, param_size());<br>
+ ArrayRef<ParmVarDecl *> parameters() const {<br>
+ return {ParamInfo, getNumParams()};<br>
}<br>
-<br>
- bool param_empty() const { return NumParams == 0; }<br>
- param_range params() { return param_range(param_begin(), param_end()); }<br>
- param_iterator param_begin() { return param_iterator(ParamInfo); }<br>
- param_iterator param_end() {<br>
- return param_iterator(ParamInfo + param_size());<br>
+ MutableArrayRef<ParmVarDecl *> parameters() {<br>
+ return {ParamInfo, getNumParams()};<br>
}<br>
<br>
- param_const_range params() const {<br>
- return param_const_range(param_begin(), param_end());<br>
- }<br>
- param_const_iterator param_begin() const {<br>
- return param_const_iterator(ParamInfo);<br>
- }<br>
- param_const_iterator param_end() const {<br>
- return param_const_iterator(ParamInfo + param_size());<br>
- }<br>
+ // Iterator access to formal parameters.<br>
+ typedef MutableArrayRef<ParmVarDecl *>::iterator param_iterator;<br>
+ typedef ArrayRef<ParmVarDecl *>::const_iterator param_const_iterator;<br>
+ bool param_empty() const { return parameters().empty(); }<br>
+ param_iterator param_begin() { return parameters().begin(); }<br>
+ param_iterator param_end() { return parameters().end(); }<br>
+ param_const_iterator param_begin() const { return parameters().begin(); }<br>
+ param_const_iterator param_end() const { return parameters().end(); }<br>
+ size_t param_size() const { return parameters().size(); }<br>
<br>
unsigned getNumParams() const { return NumParams; }<br>
const ParmVarDecl *getParamDecl(unsigned i) const {<br>
@@ -3567,22 +3543,12 @@ public:<br>
/// Does not include an entry for 'this'.<br>
unsigned getNumCaptures() const { return NumCaptures; }<br>
<br>
- typedef const Capture *capture_iterator;<br>
- typedef const Capture *capture_const_iterator;<br>
- typedef llvm::iterator_range<capture_iterator> capture_range;<br>
- typedef llvm::iterator_range<capture_const_iterator> capture_const_range;<br>
-<br>
- capture_range captures() {<br>
- return capture_range(capture_begin(), capture_end());<br>
- }<br>
- capture_const_range captures() const {<br>
- return capture_const_range(capture_begin(), capture_end());<br>
- }<br>
-<br>
- capture_iterator capture_begin() { return Captures; }<br>
- capture_iterator capture_end() { return Captures + NumCaptures; }<br>
- capture_const_iterator capture_begin() const { return Captures; }<br>
- capture_const_iterator capture_end() const { return Captures + NumCaptures; }<br>
+ typedef ArrayRef<Capture>::const_iterator capture_const_iterator;<br>
+<br>
+ ArrayRef<Capture> captures() const { return {Captures, NumCaptures}; }<br>
+<br>
+ capture_const_iterator capture_begin() const { return captures().begin(); }<br>
+ capture_const_iterator capture_end() const { return captures().end(); }<br>
<br>
bool capturesCXXThis() const { return CapturesCXXThis; }<br>
bool blockMissingReturnType() const { return BlockMissingReturnType; }<br>
@@ -3693,9 +3659,6 @@ public:<br>
/// \brief Retrieve an iterator one past the last parameter decl.<br>
param_iterator param_end() const { return getParams() + NumParams; }<br>
<br>
- /// \brief Retrieve an iterator range for the parameter declarations.<br>
- param_range params() const { return param_range(param_begin(), param_end()); }<br>
-<br>
// Implement isa/cast/dyncast/etc.<br>
static bool classof(const Decl *D) { return classofKind(D->getKind()); }<br>
static bool classofKind(Kind K) { return K == Captured; }<br>
<br>
Modified: cfe/trunk/include/clang/AST/DeclObjC.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)<br>
+++ cfe/trunk/include/clang/AST/DeclObjC.h Thu Jun 23 23:05:48 2016<br>
@@ -351,11 +351,6 @@ public:<br>
typedef llvm::iterator_range<param_iterator> param_range;<br>
typedef llvm::iterator_range<param_const_iterator> param_const_range;<br>
<br>
- param_range params() { return param_range(param_begin(), param_end()); }<br>
- param_const_range params() const {<br>
- return param_const_range(param_begin(), param_end());<br>
- }<br>
-<br>
param_const_iterator param_begin() const {<br>
return param_const_iterator(getParams());<br>
}<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Sema.h Thu Jun 23 23:05:48 2016<br>
@@ -1827,16 +1827,14 @@ public:<br>
<br>
/// \brief Diagnose any unused parameters in the given sequence of<br>
/// ParmVarDecl pointers.<br>
- void DiagnoseUnusedParameters(ParmVarDecl * const *Begin,<br>
- ParmVarDecl * const *End);<br>
+ void DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters);<br>
<br>
/// \brief Diagnose whether the size of parameters or return value of a<br>
/// function or obj-c method definition is pass-by-value and larger than a<br>
/// specified threshold.<br>
- void DiagnoseSizeOfParametersAndReturnValue(ParmVarDecl * const *Begin,<br>
- ParmVarDecl * const *End,<br>
- QualType ReturnTy,<br>
- NamedDecl *D);<br>
+ void<br>
+ DiagnoseSizeOfParametersAndReturnValue(ArrayRef<ParmVarDecl *> Parameters,<br>
+ QualType ReturnTy, NamedDecl *D);<br>
<br>
void DiagnoseInvalidJumps(Stmt *Body);<br>
Decl *ActOnFileScopeAsmDecl(Expr *expr,<br>
@@ -2665,8 +2663,7 @@ public:<br>
CallExpr *CE, FunctionDecl *FD);<br>
<br>
/// Helpers for dealing with blocks and functions.<br>
- bool CheckParmsForFunctionDef(ParmVarDecl *const *Param,<br>
- ParmVarDecl *const *ParamEnd,<br>
+ bool CheckParmsForFunctionDef(ArrayRef<ParmVarDecl *> Parameters,<br>
bool CheckParameterNames);<br>
void CheckCXXDefaultArguments(FunctionDecl *FD);<br>
void CheckExtraCXXDefaultArguments(Declarator &D);<br>
@@ -7140,8 +7137,7 @@ public:<br>
int indexAdjustment,<br>
Optional<unsigned> NumExpansions,<br>
bool ExpectParameterPack);<br>
- bool SubstParmTypes(SourceLocation Loc,<br>
- ParmVarDecl **Params, unsigned NumParams,<br>
+ bool SubstParmTypes(SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,<br>
const FunctionProtoType::ExtParameterInfo *ExtParamInfos,<br>
const MultiLevelTemplateArgumentList &TemplateArgs,<br>
SmallVectorImpl<QualType> &ParamTypes,<br>
<br>
Modified: cfe/trunk/lib/AST/ASTContext.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTContext.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Jun 23 23:05:48 2016<br>
@@ -5164,7 +5164,7 @@ std::string ASTContext::getObjCEncodingF<br>
SourceLocation Loc;<br>
CharUnits PtrSize = getTypeSizeInChars(VoidPtrTy);<br>
CharUnits ParmOffset = PtrSize;<br>
- for (auto PI : Decl->params()) {<br>
+ for (auto PI : Decl->parameters()) {<br>
QualType PType = PI->getType();<br>
CharUnits sz = getObjCEncodingTypeSize(PType);<br>
if (sz.isZero())<br>
@@ -5179,7 +5179,7 @@ std::string ASTContext::getObjCEncodingF<br>
<br>
// Argument types.<br>
ParmOffset = PtrSize;<br>
- for (auto PVDecl : Decl->params()) {<br>
+ for (auto PVDecl : Decl->parameters()) {<br>
QualType PType = PVDecl->getOriginalType();<br>
if (const ArrayType *AT =<br>
dyn_cast<ArrayType>(PType->getCanonicalTypeInternal())) {<br>
@@ -5207,7 +5207,7 @@ bool ASTContext::getObjCEncodingForFunct<br>
getObjCEncodingForType(Decl->getReturnType(), S);<br>
CharUnits ParmOffset;<br>
// Compute size of all parameters.<br>
- for (auto PI : Decl->params()) {<br>
+ for (auto PI : Decl->parameters()) {<br>
QualType PType = PI->getType();<br>
CharUnits sz = getObjCEncodingTypeSize(PType);<br>
if (sz.isZero())<br>
@@ -5221,7 +5221,7 @@ bool ASTContext::getObjCEncodingForFunct<br>
ParmOffset = CharUnits::Zero();<br>
<br>
// Argument types.<br>
- for (auto PVDecl : Decl->params()) {<br>
+ for (auto PVDecl : Decl->parameters()) {<br>
QualType PType = PVDecl->getOriginalType();<br>
if (const ArrayType *AT =<br>
dyn_cast<ArrayType>(PType->getCanonicalTypeInternal())) {<br>
<br>
Modified: cfe/trunk/lib/AST/ASTDumper.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTDumper.cpp Thu Jun 23 23:05:48 2016<br>
@@ -1681,7 +1681,7 @@ void ASTDumper::VisitObjCPropertyImplDec<br>
}<br>
<br>
void ASTDumper::VisitBlockDecl(const BlockDecl *D) {<br>
- for (auto I : D->params())<br>
+ for (auto I : D->parameters())<br>
dumpDecl(I);<br>
<br>
if (D->isVariadic())<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=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTImporter.cpp Thu Jun 23 23:05:48 2016<br>
@@ -3010,7 +3010,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl<br>
<br>
// Import the function parameters.<br>
SmallVector<ParmVarDecl *, 8> Parameters;<br>
- for (auto P : D->params()) {<br>
+ for (auto P : D->parameters()) {<br>
ParmVarDecl *ToP = cast_or_null<ParmVarDecl>(Importer.Import(P));<br>
if (!ToP)<br>
return nullptr;<br>
@@ -3276,7 +3276,7 @@ Decl *ASTNodeImporter::VisitIndirectFiel<br>
<br>
IndirectFieldDecl *ToIndirectField = IndirectFieldDecl::Create(<br>
Importer.getToContext(), DC, Loc, Name.getAsIdentifierInfo(), T,<br>
- NamedChain, D->getChainingSize());<br>
+ {NamedChain, D->getChainingSize()});<br>
<br>
for (const auto *Attr : D->attrs())<br>
ToIndirectField->addAttr(Attr->clone(Importer.getToContext()));<br>
@@ -3619,7 +3619,7 @@ Decl *ASTNodeImporter::VisitObjCMethodDe<br>
<br>
// Import the parameters<br>
SmallVector<ParmVarDecl *, 5> ToParams;<br>
- for (auto *FromP : D->params()) {<br>
+ for (auto *FromP : D->parameters()) {<br>
ParmVarDecl *ToP = cast_or_null<ParmVarDecl>(Importer.Import(FromP));<br>
if (!ToP)<br>
return nullptr;<br>
<br>
Modified: cfe/trunk/lib/AST/Comment.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Comment.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Comment.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/Comment.cpp (original)<br>
+++ cfe/trunk/lib/AST/Comment.cpp Thu Jun 23 23:05:48 2016<br>
@@ -157,7 +157,7 @@ void DeclInfo::fill() {<br>
case Decl::CXXConversion: {<br>
const FunctionDecl *FD = cast<FunctionDecl>(CommentDecl);<br>
Kind = FunctionKind;<br>
- ParamVars = llvm::makeArrayRef(FD->param_begin(), FD->getNumParams());<br>
+ ParamVars = FD->parameters();<br>
ReturnType = FD->getReturnType();<br>
unsigned NumLists = FD->getNumTemplateParameterLists();<br>
if (NumLists != 0) {<br>
@@ -177,7 +177,7 @@ void DeclInfo::fill() {<br>
case Decl::ObjCMethod: {<br>
const ObjCMethodDecl *MD = cast<ObjCMethodDecl>(CommentDecl);<br>
Kind = FunctionKind;<br>
- ParamVars = llvm::makeArrayRef(MD->param_begin(), MD->param_size());<br>
+ ParamVars = MD->parameters();<br>
ReturnType = MD->getReturnType();<br>
IsObjCMethod = true;<br>
IsInstanceMethod = MD->isInstanceMethod();<br>
@@ -189,7 +189,7 @@ void DeclInfo::fill() {<br>
Kind = FunctionKind;<br>
TemplateKind = Template;<br>
const FunctionDecl *FD = FTD->getTemplatedDecl();<br>
- ParamVars = llvm::makeArrayRef(FD->param_begin(), FD->getNumParams());<br>
+ ParamVars = FD->parameters();<br>
ReturnType = FD->getReturnType();<br>
TemplateParameters = FTD->getTemplateParameters();<br>
break;<br>
<br>
Modified: cfe/trunk/lib/AST/Decl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/Decl.cpp (original)<br>
+++ cfe/trunk/lib/AST/Decl.cpp Thu Jun 23 23:05:48 2016<br>
@@ -2793,7 +2793,7 @@ unsigned FunctionDecl::getMinRequiredArg<br>
return getNumParams();<br>
<br>
unsigned NumRequiredArgs = 0;<br>
- for (auto *Param : params())<br>
+ for (auto *Param : parameters())<br>
if (!Param->isParameterPack() && !Param->hasDefaultArg())<br>
++NumRequiredArgs;<br>
return NumRequiredArgs;<br>
@@ -4099,8 +4099,10 @@ void IndirectFieldDecl::anchor() { }<br>
<br>
IndirectFieldDecl::IndirectFieldDecl(ASTContext &C, DeclContext *DC,<br>
SourceLocation L, DeclarationName N,<br>
- QualType T, NamedDecl **CH, unsigned CHS)<br>
- : ValueDecl(IndirectField, DC, L, N, T), Chaining(CH), ChainingSize(CHS) {<br>
+ QualType T,<br>
+ MutableArrayRef<NamedDecl *> CH)<br>
+ : ValueDecl(IndirectField, DC, L, N, T), Chaining(CH.data()),<br>
+ ChainingSize(CH.size()) {<br>
// In C++, indirect field declarations conflict with tag declarations in the<br>
// same scope, so add them to IDNS_Tag so that tag redeclaration finds them.<br>
if (C.getLangOpts().CPlusPlus)<br>
@@ -4109,16 +4111,15 @@ IndirectFieldDecl::IndirectFieldDecl(AST<br>
<br>
IndirectFieldDecl *<br>
IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,<br>
- IdentifierInfo *Id, QualType T, NamedDecl **CH,<br>
- unsigned CHS) {<br>
- return new (C, DC) IndirectFieldDecl(C, DC, L, Id, T, CH, CHS);<br>
+ IdentifierInfo *Id, QualType T,<br>
+ llvm::MutableArrayRef<NamedDecl *> CH) {<br>
+ return new (C, DC) IndirectFieldDecl(C, DC, L, Id, T, CH);<br>
}<br>
<br>
IndirectFieldDecl *IndirectFieldDecl::CreateDeserialized(ASTContext &C,<br>
unsigned ID) {<br>
return new (C, ID) IndirectFieldDecl(C, nullptr, SourceLocation(),<br>
- DeclarationName(), QualType(), nullptr,<br>
- 0);<br>
+ DeclarationName(), QualType(), None);<br>
}<br>
<br>
SourceRange EnumConstantDecl::getSourceRange() const {<br>
<br>
Modified: cfe/trunk/lib/AST/DeclPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Thu Jun 23 23:05:48 2016<br>
@@ -1055,7 +1055,7 @@ void DeclPrinter::VisitObjCMethodDecl(Ob<br>
<br>
std::string name = OMD->getSelector().getAsString();<br>
std::string::size_type pos, lastPos = 0;<br>
- for (const auto *PI : OMD->params()) {<br>
+ for (const auto *PI : OMD->parameters()) {<br>
// FIXME: selector is missing here!<br>
pos = name.find_first_of(':', lastPos);<br>
Out << " " << name.substr(lastPos, pos - lastPos) << ':';<br>
<br>
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)<br>
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Thu Jun 23 23:05:48 2016<br>
@@ -2054,7 +2054,7 @@ void StmtPrinter::VisitLambdaExpr(Lambda<br>
OS << " (";<br>
CXXMethodDecl *Method = Node->getCallOperator();<br>
NeedComma = false;<br>
- for (auto P : Method->params()) {<br>
+ for (auto P : Method->parameters()) {<br>
if (NeedComma) {<br>
OS << ", ";<br>
} else {<br>
<br>
Modified: cfe/trunk/lib/Analysis/Consumed.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Consumed.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Consumed.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Analysis/Consumed.cpp (original)<br>
+++ cfe/trunk/lib/Analysis/Consumed.cpp Thu Jun 23 23:05:48 2016<br>
@@ -1362,7 +1362,7 @@ void ConsumedAnalyzer::run(AnalysisDeclC<br>
ConsumedStmtVisitor Visitor(AC, *this, CurrStates.get());<br>
<br>
// Add all trackable parameters to the state map.<br>
- for (const auto *PI : D->params())<br>
+ for (const auto *PI : D->parameters())<br>
Visitor.VisitParmVarDecl(PI);<br>
<br>
// Visit all of the function's basic blocks.<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Jun 23 23:05:48 2016<br>
@@ -402,7 +402,7 @@ CodeGenTypes::arrangeObjCMessageSendSign<br>
argTys.push_back(Context.getCanonicalParamType(receiverType));<br>
argTys.push_back(Context.getCanonicalParamType(Context.getObjCSelType()));<br>
// FIXME: Kill copy?<br>
- for (const auto *I : MD->params()) {<br>
+ for (const auto *I : MD->parameters()) {<br>
argTys.push_back(Context.getCanonicalParamType(I->getType()));<br>
}<br>
<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGClass.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Thu Jun 23 23:05:48 2016<br>
@@ -2785,7 +2785,7 @@ void CodeGenFunction::EmitLambdaBlockInv<br>
CallArgs.add(RValue::get(ThisPtr.getPointer()), ThisType);<br>
<br>
// Add the rest of the parameters.<br>
- for (auto param : BD->params())<br>
+ for (auto param : BD->parameters())<br>
EmitDelegateCallArg(CallArgs, param, param->getLocStart());<br>
<br>
assert(!Lambda->isGenericLambda() &&<br>
@@ -2815,7 +2815,7 @@ void CodeGenFunction::EmitLambdaDelegati<br>
CallArgs.add(RValue::get(ThisPtr), ThisType);<br>
<br>
// Add the rest of the parameters.<br>
- for (auto Param : MD->params())<br>
+ for (auto Param : MD->parameters())<br>
EmitDelegateCallArg(CallArgs, Param, Param->getLocStart());<br>
<br>
const CXXMethodDecl *CallOp = Lambda->getLambdaCallOperator();<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Jun 23 23:05:48 2016<br>
@@ -2766,7 +2766,7 @@ llvm::DISubroutineType *CGDebugInfo::get<br>
Elts.push_back(DBuilder.createArtificialType(<br>
getOrCreateType(CGM.getContext().getObjCSelType(), F)));<br>
// Get rest of the arguments.<br>
- for (const auto *PI : OMethod->params())<br>
+ for (const auto *PI : OMethod->parameters())<br>
Elts.push_back(getOrCreateType(PI->getType(), F));<br>
// Variadic methods need a special marker at the end of the type list.<br>
if (OMethod->isVariadic())<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Thu Jun 23 23:05:48 2016<br>
@@ -1943,7 +1943,7 @@ CGObjCCommonMac::EmitMessageSend(CodeGen<br>
// Emit a null-check if there's a consumed argument other than the receiver.<br>
bool RequiresNullCheck = false;<br>
if (ReceiverCanBeNull && CGM.getLangOpts().ObjCAutoRefCount && Method) {<br>
- for (const auto *ParamDecl : Method->params()) {<br>
+ for (const auto *ParamDecl : Method->parameters()) {<br>
if (ParamDecl->hasAttr<NSConsumedAttr>()) {<br>
if (!nullReturn.NullBB)<br>
nullReturn.init(CGF, Arg0);<br>
@@ -6828,7 +6828,7 @@ CGObjCNonFragileABIMac::EmitVTableMessag<br>
<br>
bool requiresnullCheck = false;<br>
if (CGM.getLangOpts().ObjCAutoRefCount && method)<br>
- for (const auto *ParamDecl : method->params()) {<br>
+ for (const auto *ParamDecl : method->parameters()) {<br>
if (ParamDecl->hasAttr<NSConsumedAttr>()) {<br>
if (!nullReturn.NullBB)<br>
nullReturn.init(CGF, arg0);<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Thu Jun 23 23:05:48 2016<br>
@@ -6405,7 +6405,7 @@ void CGOpenMPRuntime::emitDeclareSimdFun<br>
if (isa<CXXMethodDecl>(FD))<br>
ParamPositions.insert({FD, 0});<br>
unsigned ParamPos = ParamPositions.size();<br>
- for (auto *P : FD->params()) {<br>
+ for (auto *P : FD->parameters()) {<br>
ParamPositions.insert({P->getCanonicalDecl(), ParamPos});<br>
++ParamPos;<br>
}<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Thu Jun 23 23:05:48 2016<br>
@@ -284,7 +284,7 @@ void CodeGenFunction::EmitCallAndReturnF<br>
CGM.getCXXABI().adjustCallArgsForDestructorThunk(*this, CurGD, CallArgs);<br>
<br>
// Add the rest of the arguments.<br>
- for (const ParmVarDecl *PD : MD->params())<br>
+ for (const ParmVarDecl *PD : MD->parameters())<br>
EmitDelegateCallArg(CallArgs, PD, PD->getLocStart());<br>
<br>
const FunctionProtoType *FPT = MD->getType()->getAs<FunctionProtoType>();<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Thu Jun 23 23:05:48 2016<br>
@@ -949,7 +949,7 @@ void CodeGenFunction::GenerateCode(Globa<br>
CGM.getCXXABI().buildThisParam(*this, Args);<br>
}<br>
<br>
- for (auto *Param : FD->params()) {<br>
+ for (auto *Param : FD->parameters()) {<br>
Args.push_back(Param);<br>
if (!Param->hasAttr<PassObjectSizeAttr>())<br>
continue;<br>
<br>
Modified: cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/ObjectFilePCHContainerOperations.cpp Thu Jun 23 23:05:48 2016<br>
@@ -105,7 +105,7 @@ class PCHContainerGenerator : public AST<br>
return true;<br>
<br>
SmallVector<QualType, 16> ArgTypes;<br>
- for (auto i : D->params())<br>
+ for (auto i : D->parameters())<br>
ArgTypes.push_back(i->getType());<br>
QualType RetTy = D->getReturnType();<br>
QualType FnTy = Ctx.getFunctionType(RetTy, ArgTypes,<br>
@@ -124,7 +124,7 @@ class PCHContainerGenerator : public AST<br>
ArgTypes.push_back(D->getSelfType(Ctx, D->getClassInterface(),<br>
selfIsPseudoStrong, selfIsConsumed));<br>
ArgTypes.push_back(Ctx.getObjCSelType());<br>
- for (auto i : D->params())<br>
+ for (auto i : D->parameters())<br>
ArgTypes.push_back(i->getType());<br>
QualType RetTy = D->getReturnType();<br>
QualType FnTy = Ctx.getFunctionType(RetTy, ArgTypes,<br>
<br>
Modified: cfe/trunk/lib/Frontend/ASTConsumers.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTConsumers.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTConsumers.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/ASTConsumers.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/ASTConsumers.cpp Thu Jun 23 23:05:48 2016<br>
@@ -268,7 +268,7 @@ void DeclContextPrinter::PrintDeclContex<br>
// Print the parameters.<br>
Out << "(";<br>
bool PrintComma = false;<br>
- for (auto I : FD->params()) {<br>
+ for (auto I : FD->parameters()) {<br>
if (PrintComma)<br>
Out << ", ";<br>
else<br>
<br>
Modified: cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp Thu Jun 23 23:05:48 2016<br>
@@ -1286,7 +1286,7 @@ void RewriteModernObjC::RewriteObjCMetho<br>
ResultStr += " _cmd";<br>
<br>
// Method arguments.<br>
- for (const auto *PDecl : OMD->params()) {<br>
+ for (const auto *PDecl : OMD->parameters()) {<br>
ResultStr += ", ";<br>
if (PDecl->getType()->isObjCQualifiedIdType()) {<br>
ResultStr += "id ";<br>
@@ -2785,7 +2785,7 @@ Stmt *RewriteModernObjC::RewriteObjCArra<br>
SmallVector<QualType, 4> ArgTypes;<br>
ArgTypes.push_back(Context->getObjCClassType());<br>
ArgTypes.push_back(Context->getObjCSelType());<br>
- for (const auto *PI : ArrayMethod->params())<br>
+ for (const auto *PI : ArrayMethod->parameters())<br>
ArgTypes.push_back(PI->getType());<br>
<br>
QualType returnType = Exp->getType();<br>
@@ -2932,7 +2932,7 @@ Stmt *RewriteModernObjC::RewriteObjCDict<br>
SmallVector<QualType, 8> ArgTypes;<br>
ArgTypes.push_back(Context->getObjCClassType());<br>
ArgTypes.push_back(Context->getObjCSelType());<br>
- for (const auto *PI : DictMethod->params()) {<br>
+ for (const auto *PI : DictMethod->parameters()) {<br>
QualType T = PI->getType();<br>
if (const PointerType* PT = T->getAs<PointerType>()) {<br>
QualType PointeeTy = PT->getPointeeType();<br>
@@ -3497,7 +3497,7 @@ Stmt *RewriteModernObjC::SynthMessageExp<br>
ArgTypes.push_back(Context->getObjCSelType());<br>
if (ObjCMethodDecl *OMD = Exp->getMethodDecl()) {<br>
// Push any user argument types.<br>
- for (const auto *PI : OMD->params()) {<br>
+ for (const auto *PI : OMD->parameters()) {<br>
QualType t = PI->getType()->isObjCQualifiedIdType()<br>
? Context->getObjCIdType()<br>
: PI->getType();<br>
<br>
Modified: cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp Thu Jun 23 23:05:48 2016<br>
@@ -1118,7 +1118,7 @@ void RewriteObjC::RewriteObjCMethodDecl(<br>
ResultStr += " _cmd";<br>
<br>
// Method arguments.<br>
- for (const auto *PDecl : OMD->params()) {<br>
+ for (const auto *PDecl : OMD->parameters()) {<br>
ResultStr += ", ";<br>
if (PDecl->getType()->isObjCQualifiedIdType()) {<br>
ResultStr += "id ";<br>
@@ -2917,7 +2917,7 @@ Stmt *RewriteObjC::SynthMessageExpr(ObjC<br>
ArgTypes.push_back(Context->getObjCSelType());<br>
if (ObjCMethodDecl *OMD = Exp->getMethodDecl()) {<br>
// Push any user argument types.<br>
- for (const auto *PI : OMD->params()) {<br>
+ for (const auto *PI : OMD->parameters()) {<br>
QualType t = PI->getType()->isObjCQualifiedIdType()<br>
? Context->getObjCIdType()<br>
: PI->getType();<br>
<br>
Modified: cfe/trunk/lib/Index/IndexDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexDecl.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexDecl.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Index/IndexDecl.cpp (original)<br>
+++ cfe/trunk/lib/Index/IndexDecl.cpp Thu Jun 23 23:05:48 2016<br>
@@ -67,7 +67,7 @@ public:<br>
}<br>
} else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {<br>
if (FD->isThisDeclarationADefinition()) {<br>
- for (auto PI : FD->params()) {<br>
+ for (auto PI : FD->parameters()) {<br>
IndexCtx.handleDecl(PI);<br>
}<br>
}<br>
@@ -79,7 +79,7 @@ public:<br>
if (!IndexCtx.handleDecl(D, (unsigned)SymbolRole::Dynamic))<br>
return false;<br>
IndexCtx.indexTypeSourceInfo(D->getReturnTypeSourceInfo(), D);<br>
- for (const auto *I : D->params())<br>
+ for (const auto *I : D->parameters())<br>
handleDeclarator(I, D);<br>
<br>
if (D->isThisDeclarationADefinition()) {<br>
<br>
Modified: cfe/trunk/lib/Index/USRGeneration.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/USRGeneration.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/USRGeneration.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Index/USRGeneration.cpp (original)<br>
+++ cfe/trunk/lib/Index/USRGeneration.cpp Thu Jun 23 23:05:48 2016<br>
@@ -233,7 +233,7 @@ void USRGenerator::VisitFunctionDecl(con<br>
}<br>
<br>
// Mangle in type information for the arguments.<br>
- for (auto PD : D->params()) {<br>
+ for (auto PD : D->parameters()) {<br>
Out << '#';<br>
VisitType(PD->getType());<br>
}<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Thu Jun 23 23:05:48 2016<br>
@@ -9186,13 +9186,10 @@ static void diagnoseArrayStarInParamType<br>
/// takes care of any checks that cannot be performed on the<br>
/// declaration itself, e.g., that the types of each of the function<br>
/// parameters are complete.<br>
-bool Sema::CheckParmsForFunctionDef(ParmVarDecl *const *P,<br>
- ParmVarDecl *const *PEnd,<br>
+bool Sema::CheckParmsForFunctionDef(ArrayRef<ParmVarDecl *> Parameters,<br>
bool CheckParameterNames) {<br>
bool HasInvalidParm = false;<br>
- for (; P != PEnd; ++P) {<br>
- ParmVarDecl *Param = *P;<br>
-<br>
+ for (ParmVarDecl *Param : Parameters) {<br>
// C99 6.7.5.3p4: the parameters in a parameter type list in a<br>
// function declarator that is part of a function definition of<br>
// that function shall not have incomplete type.<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Thu Jun 23 23:05:48 2016<br>
@@ -3208,7 +3208,7 @@ static void MaybeAddOverrideCalls(Sema &<br>
<br>
// We need to have names for all of the parameters, if we're going to<br>
// generate a forwarding call.<br>
- for (auto P : Method->params())<br>
+ for (auto P : Method->parameters())<br>
if (!P->getDeclName())<br>
return;<br>
<br>
@@ -3240,7 +3240,7 @@ static void MaybeAddOverrideCalls(Sema &<br>
Overridden->getNameAsString()));<br>
Builder.AddChunk(CodeCompletionString::CK_LeftParen);<br>
bool FirstParam = true;<br>
- for (auto P : Method->params()) {<br>
+ for (auto P : Method->parameters()) {<br>
if (FirstParam)<br>
FirstParam = false;<br>
else<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Jun 23 23:05:48 2016<br>
@@ -4134,7 +4134,7 @@ InjectAnonymousStructOrUnionMembers(Sema<br>
<br>
IndirectFieldDecl *IndirectField = IndirectFieldDecl::Create(<br>
SemaRef.Context, Owner, VD->getLocation(), VD->getIdentifier(),<br>
- VD->getType(), NamedChain, Chaining.size());<br>
+ VD->getType(), {NamedChain, Chaining.size()});<br>
<br>
for (const auto *Attr : VD->attrs())<br>
IndirectField->addAttr(Attr->clone(SemaRef.Context));<br>
@@ -8529,12 +8529,10 @@ Sema::ActOnFunctionDeclarator(Scope *S,<br>
}<br>
<br>
llvm::SmallPtrSet<const Type *, 16> ValidTypes;<br>
- for (auto Param : NewFD->params())<br>
+ for (auto Param : NewFD->parameters())<br>
checkIsValidOpenCLKernelParameter(*this, D, Param, ValidTypes);<br>
}<br>
- for (FunctionDecl::param_iterator PI = NewFD->param_begin(),<br>
- PE = NewFD->param_end(); PI != PE; ++PI) {<br>
- ParmVarDecl *Param = *PI;<br>
+ for (const ParmVarDecl *Param : NewFD->parameters()) {<br>
QualType PT = Param->getType();<br>
<br>
// OpenCL 2.0 pipe restrictions forbids pipe packet types to be non-value<br>
@@ -10866,26 +10864,23 @@ ParmVarDecl *Sema::BuildParmVarDeclForTy<br>
return Param;<br>
}<br>
<br>
-void Sema::DiagnoseUnusedParameters(ParmVarDecl * const *Param,<br>
- ParmVarDecl * const *ParamEnd) {<br>
+void Sema::DiagnoseUnusedParameters(ArrayRef<ParmVarDecl *> Parameters) {<br>
// Don't diagnose unused-parameter errors in template instantiations; we<br>
// will already have done so in the template itself.<br>
if (!ActiveTemplateInstantiations.empty())<br>
return;<br>
<br>
- for (; Param != ParamEnd; ++Param) {<br>
- if (!(*Param)->isReferenced() && (*Param)->getDeclName() &&<br>
- !(*Param)->hasAttr<UnusedAttr>()) {<br>
- Diag((*Param)->getLocation(), diag::warn_unused_parameter)<br>
- << (*Param)->getDeclName();<br>
+ for (const ParmVarDecl *Parameter : Parameters) {<br>
+ if (!Parameter->isReferenced() && Parameter->getDeclName() &&<br>
+ !Parameter->hasAttr<UnusedAttr>()) {<br>
+ Diag(Parameter->getLocation(), diag::warn_unused_parameter)<br>
+ << Parameter->getDeclName();<br>
}<br>
}<br>
}<br>
<br>
-void Sema::DiagnoseSizeOfParametersAndReturnValue(ParmVarDecl * const *Param,<br>
- ParmVarDecl * const *ParamEnd,<br>
- QualType ReturnTy,<br>
- NamedDecl *D) {<br>
+void Sema::DiagnoseSizeOfParametersAndReturnValue(<br>
+ ArrayRef<ParmVarDecl *> Parameters, QualType ReturnTy, NamedDecl *D) {<br>
if (LangOpts.NumLargeByValueCopy == 0) // No check.<br>
return;<br>
<br>
@@ -10900,14 +10895,14 @@ void Sema::DiagnoseSizeOfParametersAndRe<br>
<br>
// Warn if any parameter is pass-by-value and larger than the specified<br>
// threshold.<br>
- for (; Param != ParamEnd; ++Param) {<br>
- QualType T = (*Param)->getType();<br>
+ for (const ParmVarDecl *Parameter : Parameters) {<br>
+ QualType T = Parameter->getType();<br>
if (T->isDependentType() || !T.isPODType(Context))<br>
continue;<br>
unsigned Size = Context.getTypeSizeInChars(T).getQuantity();<br>
if (Size > LangOpts.NumLargeByValueCopy)<br>
- Diag((*Param)->getLocation(), diag::warn_parameter_size)<br>
- << (*Param)->getDeclName() << Size;<br>
+ Diag(Parameter->getLocation(), diag::warn_parameter_size)<br>
+ << Parameter->getDeclName() << Size;<br>
}<br>
}<br>
<br>
@@ -11249,11 +11244,11 @@ Decl *Sema::ActOnStartOfFunctionDef(Scop<br>
PushDeclContext(FnBodyScope, FD);<br>
<br>
// Check the validity of our function parameters<br>
- CheckParmsForFunctionDef(FD->param_begin(), FD->param_end(),<br>
+ CheckParmsForFunctionDef(FD->parameters(),<br>
/*CheckParameterNames=*/true);<br>
<br>
// Introduce our parameters into the function scope<br>
- for (auto Param : FD->params()) {<br>
+ for (auto Param : FD->parameters()) {<br>
Param->setOwningFunction(FD);<br>
<br>
// If this has an identifier, add it to the scope stack.<br>
@@ -11467,8 +11462,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl<br>
if (!FD->isInvalidDecl()) {<br>
// Don't diagnose unused parameters of defaulted or deleted functions.<br>
if (!FD->isDeleted() && !FD->isDefaulted())<br>
- DiagnoseUnusedParameters(FD->param_begin(), FD->param_end());<br>
- DiagnoseSizeOfParametersAndReturnValue(FD->param_begin(), FD->param_end(),<br>
+ DiagnoseUnusedParameters(FD->parameters());<br>
+ DiagnoseSizeOfParametersAndReturnValue(FD->parameters(),<br>
FD->getReturnType(), FD);<br>
<br>
// If this is a structor, we need a vtable.<br>
@@ -11539,8 +11534,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl<br>
assert(MD == getCurMethodDecl() && "Method parsing confused");<br>
MD->setBody(Body);<br>
if (!MD->isInvalidDecl()) {<br>
- DiagnoseUnusedParameters(MD->param_begin(), MD->param_end());<br>
- DiagnoseSizeOfParametersAndReturnValue(MD->param_begin(), MD->param_end(),<br>
+ DiagnoseUnusedParameters(MD->parameters());<br>
+ DiagnoseSizeOfParametersAndReturnValue(MD->parameters(),<br>
MD->getReturnType(), MD);<br>
<br>
if (Body)<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Jun 23 23:05:48 2016<br>
@@ -11823,7 +11823,7 @@ bool Sema::CheckOverloadedOperatorDeclar<br>
diag::err_operator_overload_static) << FnDecl->getDeclName();<br>
} else {<br>
bool ClassOrEnumParam = false;<br>
- for (auto Param : FnDecl->params()) {<br>
+ for (auto Param : FnDecl->parameters()) {<br>
QualType ParamType = Param->getType().getNonReferenceType();<br>
if (ParamType->isDependentType() || ParamType->isRecordType() ||<br>
ParamType->isEnumeralType()) {<br>
@@ -11845,7 +11845,7 @@ bool Sema::CheckOverloadedOperatorDeclar<br>
// Only the function-call operator allows default arguments<br>
// (C++ [over.call]p1).<br>
if (Op != OO_Call) {<br>
- for (auto Param : FnDecl->params()) {<br>
+ for (auto Param : FnDecl->parameters()) {<br>
if (Param->hasDefaultArg())<br>
return Diag(Param->getLocation(),<br>
diag::err_operator_overload_default_arg)<br>
@@ -12110,7 +12110,7 @@ bool Sema::CheckLiteralOperatorDeclarati<br>
<br>
// A parameter-declaration-clause containing a default argument is not<br>
// equivalent to any of the permitted forms.<br>
- for (auto Param : FnDecl->params()) {<br>
+ for (auto Param : FnDecl->parameters()) {<br>
if (Param->hasDefaultArg()) {<br>
Diag(Param->getDefaultArgRange().getBegin(),<br>
diag::err_literal_operator_default_argument)<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Thu Jun 23 23:05:48 2016<br>
@@ -319,11 +319,11 @@ void Sema::ActOnStartOfObjCMethodDef(Sco<br>
PushOnScopeChains(MDecl->getCmdDecl(), FnBodyScope);<br>
<br>
// The ObjC parser requires parameter names so there's no need to check.<br>
- CheckParmsForFunctionDef(MDecl->param_begin(), MDecl->param_end(),<br>
+ CheckParmsForFunctionDef(MDecl->parameters(),<br>
/*CheckParameterNames=*/false);<br>
<br>
// Introduce all of the other parameters into this scope.<br>
- for (auto *Param : MDecl->params()) {<br>
+ for (auto *Param : MDecl->parameters()) {<br>
if (!Param->isInvalidDecl() &&<br>
getLangOpts().ObjCAutoRefCount &&<br>
!HasExplicitOwnershipAttr(*this, Param))<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu Jun 23 23:05:48 2016<br>
@@ -12028,8 +12028,7 @@ void Sema::ActOnBlockArguments(SourceLoc<br>
// Set the parameters on the block decl.<br>
if (!Params.empty()) {<br>
CurBlock->TheDecl->setParams(Params);<br>
- CheckParmsForFunctionDef(CurBlock->TheDecl->param_begin(),<br>
- CurBlock->TheDecl->param_end(),<br>
+ CheckParmsForFunctionDef(CurBlock->TheDecl->parameters(),<br>
/*CheckParameterNames=*/false);<br>
}<br>
<br>
@@ -12037,7 +12036,7 @@ void Sema::ActOnBlockArguments(SourceLoc<br>
ProcessDeclAttributes(CurScope, CurBlock->TheDecl, ParamInfo);<br>
<br>
// Put the parameter variables in scope.<br>
- for (auto AI : CurBlock->TheDecl->params()) {<br>
+ for (auto AI : CurBlock->TheDecl->parameters()) {<br>
AI->setOwningFunction(CurBlock->TheDecl);<br>
<br>
// If this has an identifier, add it to the scope stack.<br>
@@ -12137,8 +12136,7 @@ ExprResult Sema::ActOnBlockStmtExpr(Sour<br>
BlockTy = Context.getFunctionType(RetTy, None, EPI);<br>
}<br>
<br>
- DiagnoseUnusedParameters(BSI->TheDecl->param_begin(),<br>
- BSI->TheDecl->param_end());<br>
+ DiagnoseUnusedParameters(BSI->TheDecl->parameters());<br>
BlockTy = Context.getBlockPointerType(BlockTy);<br>
<br>
// If needed, diagnose invalid gotos and switches in the block.<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaLambda.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLambda.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLambda.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaLambda.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaLambda.cpp Thu Jun 23 23:05:48 2016<br>
@@ -415,11 +415,10 @@ CXXMethodDecl *Sema::startLambdaDefiniti<br>
// Add parameters.<br>
if (!Params.empty()) {<br>
Method->setParams(Params);<br>
- CheckParmsForFunctionDef(const_cast<ParmVarDecl **>(Params.begin()),<br>
- const_cast<ParmVarDecl **>(Params.end()),<br>
+ CheckParmsForFunctionDef(Params,<br>
/*CheckParameterNames=*/false);<br>
-<br>
- for (auto P : Method->params())<br>
+<br>
+ for (auto P : Method->parameters())<br>
P->setOwningFunction(Method);<br>
}<br>
<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Thu Jun 23 23:05:48 2016<br>
@@ -2480,7 +2480,7 @@ Sema::SubstituteExplicitTemplateArgument<br>
if (ExplicitTemplateArgs.size() == 0) {<br>
// No arguments to substitute; just copy over the parameter types and<br>
// fill in the function type.<br>
- for (auto P : Function->params())<br>
+ for (auto P : Function->parameters())<br>
ParamTypes.push_back(P->getType());<br>
<br>
if (FunctionType)<br>
@@ -2563,8 +2563,7 @@ Sema::SubstituteExplicitTemplateArgument<br>
// return type, substitute it after the arguments to ensure we substitute<br>
// in lexical order.<br>
if (Proto->hasTrailingReturn()) {<br>
- if (SubstParmTypes(Function->getLocation(),<br>
- Function->param_begin(), Function->getNumParams(),<br>
+ if (SubstParmTypes(Function->getLocation(), Function->parameters(),<br>
Proto->getExtParameterInfosOrNull(),<br>
MultiLevelTemplateArgumentList(*ExplicitArgumentList),<br>
ParamTypes, /*params*/ nullptr, ExtParamInfos))<br>
@@ -2601,8 +2600,7 @@ Sema::SubstituteExplicitTemplateArgument<br>
// Instantiate the types of each of the function parameters given the<br>
// explicitly-specified template arguments if we didn't do so earlier.<br>
if (!Proto->hasTrailingReturn() &&<br>
- SubstParmTypes(Function->getLocation(),<br>
- Function->param_begin(), Function->getNumParams(),<br>
+ SubstParmTypes(Function->getLocation(), Function->parameters(),<br>
Proto->getExtParameterInfosOrNull(),<br>
MultiLevelTemplateArgumentList(*ExplicitArgumentList),<br>
ParamTypes, /*params*/ nullptr, ExtParamInfos))<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Thu Jun 23 23:05:48 2016<br>
@@ -1714,23 +1714,21 @@ ParmVarDecl *Sema::SubstParmVarDecl(Parm<br>
/// \brief Substitute the given template arguments into the given set of<br>
/// parameters, producing the set of parameter types that would be generated<br>
/// from such a substitution.<br>
-bool Sema::SubstParmTypes(SourceLocation Loc,<br>
- ParmVarDecl **Params, unsigned NumParams,<br>
- const FunctionProtoType::ExtParameterInfo *ExtParamInfos,<br>
- const MultiLevelTemplateArgumentList &TemplateArgs,<br>
- SmallVectorImpl<QualType> &ParamTypes,<br>
- SmallVectorImpl<ParmVarDecl *> *OutParams,<br>
- ExtParameterInfoBuilder &ParamInfos) {<br>
+bool Sema::SubstParmTypes(<br>
+ SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,<br>
+ const FunctionProtoType::ExtParameterInfo *ExtParamInfos,<br>
+ const MultiLevelTemplateArgumentList &TemplateArgs,<br>
+ SmallVectorImpl<QualType> &ParamTypes,<br>
+ SmallVectorImpl<ParmVarDecl *> *OutParams,<br>
+ ExtParameterInfoBuilder &ParamInfos) {<br>
assert(!ActiveTemplateInstantiations.empty() &&<br>
"Cannot perform an instantiation without some context on the "<br>
"instantiation stack");<br>
<br>
TemplateInstantiator Instantiator(*this, TemplateArgs, Loc,<br>
DeclarationName());<br>
- return Instantiator.TransformFunctionTypeParams(Loc, Params, NumParams,<br>
- nullptr, ExtParamInfos,<br>
- ParamTypes, OutParams,<br>
- ParamInfos);<br>
+ return Instantiator.TransformFunctionTypeParams(<br>
+ Loc, Params, nullptr, ExtParamInfos, ParamTypes, OutParams, ParamInfos);<br>
}<br>
<br>
/// \brief Perform substitution on the base class specifiers of the<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Thu Jun 23 23:05:48 2016<br>
@@ -803,7 +803,7 @@ Decl *TemplateDeclInstantiator::VisitInd<br>
QualType T = cast<FieldDecl>(NamedChain[i-1])->getType();<br>
IndirectFieldDecl *IndirectField = IndirectFieldDecl::Create(<br>
SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), T,<br>
- NamedChain, D->getChainingSize());<br>
+ {NamedChain, D->getChainingSize()});<br>
<br>
for (const auto *Attr : D->attrs())<br>
IndirectField->addAttr(Attr->clone(SemaRef.Context));<br>
@@ -3301,9 +3301,9 @@ TemplateDeclInstantiator::SubstFunctionT<br>
// synthesized in the method declaration.<br>
SmallVector<QualType, 4> ParamTypes;<br>
Sema::ExtParameterInfoBuilder ExtParamInfos;<br>
- if (SemaRef.SubstParmTypes(D->getLocation(), D->param_begin(),<br>
- D->getNumParams(), nullptr, TemplateArgs,<br>
- ParamTypes, &Params, ExtParamInfos))<br>
+ if (SemaRef.SubstParmTypes(D->getLocation(), D->parameters(), nullptr,<br>
+ TemplateArgs, ParamTypes, &Params,<br>
+ ExtParamInfos))<br>
return nullptr;<br>
}<br>
<br>
<br>
Modified: cfe/trunk/lib/Sema/TreeTransform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/TreeTransform.h (original)<br>
+++ cfe/trunk/lib/Sema/TreeTransform.h Thu Jun 23 23:05:48 2016<br>
@@ -612,13 +612,12 @@ public:<br>
/// variables vector are acceptable.<br>
///<br>
/// Return true on error.<br>
- bool TransformFunctionTypeParams(SourceLocation Loc,<br>
- ParmVarDecl **Params, unsigned NumParams,<br>
- const QualType *ParamTypes,<br>
- const FunctionProtoType::ExtParameterInfo *ParamInfos,<br>
- SmallVectorImpl<QualType> &PTypes,<br>
- SmallVectorImpl<ParmVarDecl*> *PVars,<br>
- Sema::ExtParameterInfoBuilder &PInfos);<br>
+ bool TransformFunctionTypeParams(<br>
+ SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,<br>
+ const QualType *ParamTypes,<br>
+ const FunctionProtoType::ExtParameterInfo *ParamInfos,<br>
+ SmallVectorImpl<QualType> &PTypes, SmallVectorImpl<ParmVarDecl *> *PVars,<br>
+ Sema::ExtParameterInfoBuilder &PInfos);<br>
<br>
/// \brief Transforms a single function-type parameter. Return null<br>
/// on error.<br>
@@ -4663,17 +4662,17 @@ ParmVarDecl *TreeTransform<Derived>::Tra<br>
return newParm;<br>
}<br>
<br>
-template<typename Derived><br>
-bool TreeTransform<Derived>::<br>
- TransformFunctionTypeParams(SourceLocation Loc,<br>
- ParmVarDecl **Params, unsigned NumParams,<br>
- const QualType *ParamTypes,<br>
- const FunctionProtoType::ExtParameterInfo *ParamInfos,<br>
- SmallVectorImpl<QualType> &OutParamTypes,<br>
- SmallVectorImpl<ParmVarDecl*> *PVars,<br>
- Sema::ExtParameterInfoBuilder &PInfos) {<br>
+template <typename Derived><br>
+bool TreeTransform<Derived>::TransformFunctionTypeParams(<br>
+ SourceLocation Loc, ArrayRef<ParmVarDecl *> Params,<br>
+ const QualType *ParamTypes,<br>
+ const FunctionProtoType::ExtParameterInfo *ParamInfos,<br>
+ SmallVectorImpl<QualType> &OutParamTypes,<br>
+ SmallVectorImpl<ParmVarDecl *> *PVars,<br>
+ Sema::ExtParameterInfoBuilder &PInfos) {<br>
int indexAdjustment = 0;<br>
<br>
+ unsigned NumParams = Params.size();<br>
for (unsigned i = 0; i != NumParams; ++i) {<br>
if (ParmVarDecl *OldParm = Params[i]) {<br>
assert(OldParm->getFunctionScopeIndex() == i);<br>
@@ -4908,7 +4907,7 @@ QualType TreeTransform<Derived>::Transfo<br>
<br>
if (T->hasTrailingReturn()) {<br>
if (getDerived().TransformFunctionTypeParams(<br>
- TL.getBeginLoc(), TL.getParmArray(), TL.getNumParams(),<br>
+ TL.getBeginLoc(), TL.getParams(),<br>
TL.getTypePtr()->param_type_begin(),<br>
T->getExtParameterInfosOrNull(),<br>
ParamTypes, &ParamDecls, ExtParamInfos))<br>
@@ -4934,7 +4933,7 @@ QualType TreeTransform<Derived>::Transfo<br>
return QualType();<br>
<br>
if (getDerived().TransformFunctionTypeParams(<br>
- TL.getBeginLoc(), TL.getParmArray(), TL.getNumParams(),<br>
+ TL.getBeginLoc(), TL.getParams(),<br>
TL.getTypePtr()->param_type_begin(),<br>
T->getExtParameterInfosOrNull(),<br>
ParamTypes, &ParamDecls, ExtParamInfos))<br>
@@ -11196,13 +11195,10 @@ TreeTransform<Derived>::TransformBlockEx<br>
<br>
// Parameter substitution.<br>
Sema::ExtParameterInfoBuilder extParamInfos;<br>
- if (getDerived().TransformFunctionTypeParams(E->getCaretLocation(),<br>
- oldBlock->param_begin(),<br>
- oldBlock->param_size(),<br>
- nullptr,<br>
- exprFunctionType->getExtParameterInfosOrNull(),<br>
- paramTypes, ¶ms,<br>
- extParamInfos)) {<br>
+ if (getDerived().TransformFunctionTypeParams(<br>
+ E->getCaretLocation(), oldBlock->parameters(), nullptr,<br>
+ exprFunctionType->getExtParameterInfosOrNull(), paramTypes, ¶ms,<br>
+ extParamInfos)) {<br>
getSema().ActOnBlockError(E->getCaretLocation(), /*Scope=*/nullptr);<br>
return ExprError();<br>
}<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=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Thu Jun 23 23:05:48 2016<br>
@@ -597,7 +597,7 @@ void ASTDeclWriter::VisitFunctionDecl(Fu<br>
}<br>
<br>
Record.push_back(D->param_size());<br>
- for (auto P : D->params())<br>
+ for (auto P : D->parameters())<br>
Record.AddDeclRef(P);<br>
Code = serialization::DECL_FUNCTION;<br>
}<br>
@@ -637,7 +637,7 @@ void ASTDeclWriter::VisitObjCMethodDecl(<br>
Record.AddTypeSourceInfo(D->getReturnTypeSourceInfo());<br>
Record.AddSourceLocation(D->getLocEnd());<br>
Record.push_back(D->param_size());<br>
- for (const auto *P : D->params())<br>
+ for (const auto *P : D->parameters())<br>
Record.AddDeclRef(P);<br>
<br>
Record.push_back(D->SelLocsKind);<br>
<br>
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp (original)<br>
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp Thu Jun 23 23:05:48 2016<br>
@@ -944,7 +944,7 @@ static bool treatUnusedNewEscaped(const<br>
const CXXConstructorDecl *CtorD = ConstructE->getConstructor();<br>
<br>
// Iterate over the constructor parameters.<br>
- for (const auto *CtorParam : CtorD->params()) {<br>
+ for (const auto *CtorParam : CtorD->parameters()) {<br>
<br>
QualType CtorParamPointeeT = CtorParam->getType()->getPointeeType();<br>
if (CtorParamPointeeT.isNull())<br>
<br>
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp (original)<br>
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp Thu Jun 23 23:05:48 2016<br>
@@ -61,7 +61,7 @@ void NSErrorMethodChecker::checkASTDecl(<br>
II = &D->getASTContext().Idents.get("NSError");<br>
<br>
bool hasNSError = false;<br>
- for (const auto *I : D->params()) {<br>
+ for (const auto *I : D->parameters()) {<br>
if (IsNSError(I->getType(), II)) {<br>
hasNSError = true;<br>
break;<br>
@@ -108,7 +108,7 @@ void CFErrorFunctionChecker::checkASTDec<br>
II = &D->getASTContext().Idents.get("CFErrorRef");<br>
<br>
bool hasCFError = false;<br>
- for (auto I : D->params()) {<br>
+ for (auto I : D->parameters()) {<br>
if (IsCFError(I->getType(), II)) {<br>
hasCFError = true;<br>
break;<br>
<br>
Modified: cfe/trunk/tools/libclang/CIndex.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=273647&r1=273646&r2=273647&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=273647&r1=273646&r2=273647&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/tools/libclang/CIndex.cpp (original)<br>
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu Jun 23 23:05:48 2016<br>
@@ -935,7 +935,7 @@ bool CursorVisitor::VisitObjCMethodDecl(<br>
if (Visit(TSInfo->getTypeLoc()))<br>
return true;<br>
<br>
- for (const auto *P : ND->params()) {<br>
+ for (const auto *P : ND->parameters()) {<br>
if (Visit(MakeCXCursor(P, TU, RegionOfInterest)))<br>
return true;<br>
}<br>
@@ -6278,7 +6278,7 @@ AnnotateTokensWorker::Visit(CXCursor cur<br>
if (Method->getObjCDeclQualifier())<br>
HasContextSensitiveKeywords = true;<br>
else {<br>
- for (const auto *P : Method->params()) {<br>
+ for (const auto *P : Method->parameters()) {<br>
if (P->getObjCDeclQualifier()) {<br>
HasContextSensitiveKeywords = true;<br>
break;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">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></div></blockquote></div><br></div>