зеркало из https://github.com/microsoft/clang-1.git
Switch over a few uses of param_begin() to parameters()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212442 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
5676ff327f
Коммит
e9a2e9d4e3
|
@ -5322,7 +5322,7 @@ static QualType getPreferredArgumentTypeForMessageSend(ResultBuilder &Results,
|
|||
if (R.Priority <= BestPriority) {
|
||||
const ObjCMethodDecl *Method = cast<ObjCMethodDecl>(R.Declaration);
|
||||
if (NumSelIdents <= Method->param_size()) {
|
||||
QualType MyPreferredType = Method->param_begin()[NumSelIdents - 1]
|
||||
QualType MyPreferredType = Method->parameters()[NumSelIdents - 1]
|
||||
->getType();
|
||||
if (R.Priority < BestPriority || PreferredType.isNull()) {
|
||||
BestPriority = R.Priority;
|
||||
|
@ -6994,7 +6994,7 @@ void Sema::CodeCompleteObjCMethodDeclSelector(Scope *S,
|
|||
// Suggest parameter names we've seen before.
|
||||
unsigned NumSelIdents = SelIdents.size();
|
||||
if (NumSelIdents && NumSelIdents <= MethList->Method->param_size()) {
|
||||
ParmVarDecl *Param = MethList->Method->param_begin()[NumSelIdents-1];
|
||||
ParmVarDecl *Param = MethList->Method->parameters()[NumSelIdents-1];
|
||||
if (Param->getIdentifier()) {
|
||||
CodeCompletionBuilder Builder(Results.getAllocator(),
|
||||
Results.getCodeCompletionTUInfo());
|
||||
|
|
|
@ -85,7 +85,7 @@ static QualType getFunctionOrMethodParamType(const Decl *D, unsigned Idx) {
|
|||
if (const BlockDecl *BD = dyn_cast<BlockDecl>(D))
|
||||
return BD->getParamDecl(Idx)->getType();
|
||||
|
||||
return cast<ObjCMethodDecl>(D)->param_begin()[Idx]->getType();
|
||||
return cast<ObjCMethodDecl>(D)->parameters()[Idx]->getType();
|
||||
}
|
||||
|
||||
static QualType getFunctionOrMethodResultType(const Decl *D) {
|
||||
|
|
|
@ -7694,7 +7694,7 @@ static bool hasIsEqualMethod(Sema &S, const Expr *LHS, const Expr *RHS) {
|
|||
if (!Method)
|
||||
return false;
|
||||
|
||||
QualType T = Method->param_begin()[0]->getType();
|
||||
QualType T = Method->parameters()[0]->getType();
|
||||
if (!T->isObjCObjectPointerType())
|
||||
return false;
|
||||
|
||||
|
|
|
@ -291,7 +291,7 @@ ExprResult Sema::BuildObjCNumericLiteral(SourceLocation AtLoc, Expr *Number) {
|
|||
return ExprError();
|
||||
|
||||
// Convert the number to the type that the parameter expects.
|
||||
ParmVarDecl *ParamDecl = Method->param_begin()[0];
|
||||
ParmVarDecl *ParamDecl = Method->parameters()[0];
|
||||
InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
|
||||
ParamDecl);
|
||||
ExprResult ConvertedNumber = PerformCopyInitialization(Entity,
|
||||
|
@ -581,7 +581,7 @@ ExprResult Sema::BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) {
|
|||
}
|
||||
|
||||
// Convert the expression to the type that the parameter requires.
|
||||
ParmVarDecl *ParamDecl = BoxingMethod->param_begin()[0];
|
||||
ParmVarDecl *ParamDecl = BoxingMethod->parameters()[0];
|
||||
InitializedEntity Entity = InitializedEntity::InitializeParameter(Context,
|
||||
ParamDecl);
|
||||
ExprResult ConvertedValueExpr = PerformCopyInitialization(Entity,
|
||||
|
@ -689,13 +689,13 @@ ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {
|
|||
return ExprError();
|
||||
|
||||
// Dig out the type that all elements should be converted to.
|
||||
QualType T = Method->param_begin()[0]->getType();
|
||||
QualType T = Method->parameters()[0]->getType();
|
||||
const PointerType *PtrT = T->getAs<PointerType>();
|
||||
if (!PtrT ||
|
||||
!Context.hasSameUnqualifiedType(PtrT->getPointeeType(), IdT)) {
|
||||
Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
|
||||
<< Sel;
|
||||
Diag(Method->param_begin()[0]->getLocation(),
|
||||
Diag(Method->parameters()[0]->getLocation(),
|
||||
diag::note_objc_literal_method_param)
|
||||
<< 0 << T
|
||||
<< Context.getPointerType(IdT.withConst());
|
||||
|
@ -703,13 +703,13 @@ ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {
|
|||
}
|
||||
|
||||
// Check that the 'count' parameter is integral.
|
||||
if (!Method->param_begin()[1]->getType()->isIntegerType()) {
|
||||
if (!Method->parameters()[1]->getType()->isIntegerType()) {
|
||||
Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
|
||||
<< Sel;
|
||||
Diag(Method->param_begin()[1]->getLocation(),
|
||||
Diag(Method->parameters()[1]->getLocation(),
|
||||
diag::note_objc_literal_method_param)
|
||||
<< 1
|
||||
<< Method->param_begin()[1]->getType()
|
||||
<< Method->parameters()[1]->getType()
|
||||
<< "integral";
|
||||
return ExprError();
|
||||
}
|
||||
|
@ -718,7 +718,7 @@ ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {
|
|||
ArrayWithObjectsMethod = Method;
|
||||
}
|
||||
|
||||
QualType ObjectsType = ArrayWithObjectsMethod->param_begin()[0]->getType();
|
||||
QualType ObjectsType = ArrayWithObjectsMethod->parameters()[0]->getType();
|
||||
QualType RequiredType = ObjectsType->castAs<PointerType>()->getPointeeType();
|
||||
|
||||
// Check that each of the elements provided is valid in a collection literal,
|
||||
|
@ -816,13 +816,13 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
|
|||
return ExprError();
|
||||
|
||||
// Dig out the type that all values should be converted to.
|
||||
QualType ValueT = Method->param_begin()[0]->getType();
|
||||
QualType ValueT = Method->parameters()[0]->getType();
|
||||
const PointerType *PtrValue = ValueT->getAs<PointerType>();
|
||||
if (!PtrValue ||
|
||||
!Context.hasSameUnqualifiedType(PtrValue->getPointeeType(), IdT)) {
|
||||
Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
|
||||
<< Sel;
|
||||
Diag(Method->param_begin()[0]->getLocation(),
|
||||
Diag(Method->parameters()[0]->getLocation(),
|
||||
diag::note_objc_literal_method_param)
|
||||
<< 0 << ValueT
|
||||
<< Context.getPointerType(IdT.withConst());
|
||||
|
@ -830,7 +830,7 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
|
|||
}
|
||||
|
||||
// Dig out the type that all keys should be converted to.
|
||||
QualType KeyT = Method->param_begin()[1]->getType();
|
||||
QualType KeyT = Method->parameters()[1]->getType();
|
||||
const PointerType *PtrKey = KeyT->getAs<PointerType>();
|
||||
if (!PtrKey ||
|
||||
!Context.hasSameUnqualifiedType(PtrKey->getPointeeType(),
|
||||
|
@ -856,7 +856,7 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
|
|||
if (err) {
|
||||
Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
|
||||
<< Sel;
|
||||
Diag(Method->param_begin()[1]->getLocation(),
|
||||
Diag(Method->parameters()[1]->getLocation(),
|
||||
diag::note_objc_literal_method_param)
|
||||
<< 1 << KeyT
|
||||
<< Context.getPointerType(IdT.withConst());
|
||||
|
@ -865,11 +865,11 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
|
|||
}
|
||||
|
||||
// Check that the 'count' parameter is integral.
|
||||
QualType CountType = Method->param_begin()[2]->getType();
|
||||
QualType CountType = Method->parameters()[2]->getType();
|
||||
if (!CountType->isIntegerType()) {
|
||||
Diag(SR.getBegin(), diag::err_objc_literal_method_sig)
|
||||
<< Sel;
|
||||
Diag(Method->param_begin()[2]->getLocation(),
|
||||
Diag(Method->parameters()[2]->getLocation(),
|
||||
diag::note_objc_literal_method_param)
|
||||
<< 2 << CountType
|
||||
<< "integral";
|
||||
|
@ -880,9 +880,9 @@ ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
|
|||
DictionaryWithObjectsMethod = Method;
|
||||
}
|
||||
|
||||
QualType ValuesT = DictionaryWithObjectsMethod->param_begin()[0]->getType();
|
||||
QualType ValuesT = DictionaryWithObjectsMethod->parameters()[0]->getType();
|
||||
QualType ValueT = ValuesT->castAs<PointerType>()->getPointeeType();
|
||||
QualType KeysT = DictionaryWithObjectsMethod->param_begin()[1]->getType();
|
||||
QualType KeysT = DictionaryWithObjectsMethod->parameters()[1]->getType();
|
||||
QualType KeyT = KeysT->castAs<PointerType>()->getPointeeType();
|
||||
|
||||
// Check that each of the keys and values provided is valid in a collection
|
||||
|
@ -1368,7 +1368,7 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
|
|||
|
||||
Expr *argExpr = Args[i];
|
||||
|
||||
ParmVarDecl *param = Method->param_begin()[i];
|
||||
ParmVarDecl *param = Method->parameters()[i];
|
||||
assert(argExpr && "CheckMessageArgumentTypes(): missing expression");
|
||||
|
||||
// Strip the unbridged-cast placeholder expression off unless it's
|
||||
|
|
|
@ -1099,7 +1099,7 @@ static void CheckKeyForObjCARCConversion(Sema &S, QualType ContainerT,
|
|||
true /*instance*/);
|
||||
if (!Getter)
|
||||
return;
|
||||
QualType T = Getter->param_begin()[0]->getType();
|
||||
QualType T = Getter->parameters()[0]->getType();
|
||||
S.CheckObjCARCConversion(Key->getSourceRange(),
|
||||
T, Key, Sema::CCK_ImplicitConversion);
|
||||
}
|
||||
|
@ -1192,13 +1192,13 @@ bool ObjCSubscriptOpBuilder::findAtIndexGetter() {
|
|||
}
|
||||
|
||||
if (AtIndexGetter) {
|
||||
QualType T = AtIndexGetter->param_begin()[0]->getType();
|
||||
QualType T = AtIndexGetter->parameters()[0]->getType();
|
||||
if ((arrayRef && !T->isIntegralOrEnumerationType()) ||
|
||||
(!arrayRef && !T->isObjCObjectPointerType())) {
|
||||
S.Diag(RefExpr->getKeyExpr()->getExprLoc(),
|
||||
arrayRef ? diag::err_objc_subscript_index_type
|
||||
: diag::err_objc_subscript_key_type) << T;
|
||||
S.Diag(AtIndexGetter->param_begin()[0]->getLocation(),
|
||||
S.Diag(AtIndexGetter->parameters()[0]->getLocation(),
|
||||
diag::note_parameter_type) << T;
|
||||
return false;
|
||||
}
|
||||
|
@ -1315,26 +1315,26 @@ bool ObjCSubscriptOpBuilder::findAtIndexSetter() {
|
|||
|
||||
bool err = false;
|
||||
if (AtIndexSetter && arrayRef) {
|
||||
QualType T = AtIndexSetter->param_begin()[1]->getType();
|
||||
QualType T = AtIndexSetter->parameters()[1]->getType();
|
||||
if (!T->isIntegralOrEnumerationType()) {
|
||||
S.Diag(RefExpr->getKeyExpr()->getExprLoc(),
|
||||
diag::err_objc_subscript_index_type) << T;
|
||||
S.Diag(AtIndexSetter->param_begin()[1]->getLocation(),
|
||||
S.Diag(AtIndexSetter->parameters()[1]->getLocation(),
|
||||
diag::note_parameter_type) << T;
|
||||
err = true;
|
||||
}
|
||||
T = AtIndexSetter->param_begin()[0]->getType();
|
||||
T = AtIndexSetter->parameters()[0]->getType();
|
||||
if (!T->isObjCObjectPointerType()) {
|
||||
S.Diag(RefExpr->getBaseExpr()->getExprLoc(),
|
||||
diag::err_objc_subscript_object_type) << T << arrayRef;
|
||||
S.Diag(AtIndexSetter->param_begin()[0]->getLocation(),
|
||||
S.Diag(AtIndexSetter->parameters()[0]->getLocation(),
|
||||
diag::note_parameter_type) << T;
|
||||
err = true;
|
||||
}
|
||||
}
|
||||
else if (AtIndexSetter && !arrayRef)
|
||||
for (unsigned i=0; i <2; i++) {
|
||||
QualType T = AtIndexSetter->param_begin()[i]->getType();
|
||||
QualType T = AtIndexSetter->parameters()[i]->getType();
|
||||
if (!T->isObjCObjectPointerType()) {
|
||||
if (i == 1)
|
||||
S.Diag(RefExpr->getKeyExpr()->getExprLoc(),
|
||||
|
@ -1342,7 +1342,7 @@ bool ObjCSubscriptOpBuilder::findAtIndexSetter() {
|
|||
else
|
||||
S.Diag(RefExpr->getBaseExpr()->getExprLoc(),
|
||||
diag::err_objc_subscript_dic_object_type) << T;
|
||||
S.Diag(AtIndexSetter->param_begin()[i]->getLocation(),
|
||||
S.Diag(AtIndexSetter->parameters()[i]->getLocation(),
|
||||
diag::note_parameter_type) << T;
|
||||
err = true;
|
||||
}
|
||||
|
|
|
@ -1005,11 +1005,11 @@ CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i) {
|
|||
const Decl *D = cxcursor::getCursorDecl(C);
|
||||
if (const ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(D)) {
|
||||
if (i < MD->param_size())
|
||||
return cxcursor::MakeCXCursor(MD->param_begin()[i],
|
||||
return cxcursor::MakeCXCursor(MD->parameters()[i],
|
||||
cxcursor::getCursorTU(C));
|
||||
} else if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) {
|
||||
if (i < FD->param_size())
|
||||
return cxcursor::MakeCXCursor(FD->param_begin()[i],
|
||||
return cxcursor::MakeCXCursor(FD->parameters()[i],
|
||||
cxcursor::getCursorTU(C));
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче