diff options
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 054cb6afbde..c706ab6ff09 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -72,7 +72,7 @@ static bool hasFunctionProto(const Decl *D) { /// hasFunctionProto first). static unsigned getFunctionOrMethodNumArgs(const Decl *D) { if (const FunctionType *FnTy = D->getFunctionType()) - return cast<FunctionProtoType>(FnTy)->getNumArgs(); + return cast<FunctionProtoType>(FnTy)->getNumParams(); if (const BlockDecl *BD = dyn_cast<BlockDecl>(D)) return BD->getNumParams(); return cast<ObjCMethodDecl>(D)->param_size(); @@ -80,7 +80,7 @@ static unsigned getFunctionOrMethodNumArgs(const Decl *D) { static QualType getFunctionOrMethodArgType(const Decl *D, unsigned Idx) { if (const FunctionType *FnTy = D->getFunctionType()) - return cast<FunctionProtoType>(FnTy)->getArgType(Idx); + return cast<FunctionProtoType>(FnTy)->getParamType(Idx); if (const BlockDecl *BD = dyn_cast<BlockDecl>(D)) return BD->getParamDecl(Idx)->getType(); @@ -4343,8 +4343,9 @@ NamedDecl * Sema::DeclClonePragmaWeak(NamedDecl *ND, IdentifierInfo *II, QualType FDTy = FD->getType(); if (const FunctionProtoType *FT = FDTy->getAs<FunctionProtoType>()) { SmallVector<ParmVarDecl*, 16> Params; - for (FunctionProtoType::arg_type_iterator AI = FT->arg_type_begin(), - AE = FT->arg_type_end(); AI != AE; ++AI) { + for (FunctionProtoType::param_type_iterator AI = FT->param_type_begin(), + AE = FT->param_type_end(); + AI != AE; ++AI) { ParmVarDecl *Param = BuildParmVarDeclForTypedef(NewFD, Loc, *AI); Param->setScopeInfo(0, Params.size()); Params.push_back(Param); |

