summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 7a1cd71c262..4d864f2128c 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -2308,7 +2308,8 @@ bool FunctionDecl::isReservedGlobalPlacementOperator() const {
return false;
const FunctionProtoType *proto = getType()->castAs<FunctionProtoType>();
- if (proto->getNumArgs() != 2 || proto->isVariadic()) return false;
+ if (proto->getNumParams() != 2 || proto->isVariadic())
+ return false;
ASTContext &Context =
cast<TranslationUnitDecl>(getDeclContext()->getRedeclContext())
@@ -2316,7 +2317,7 @@ bool FunctionDecl::isReservedGlobalPlacementOperator() const {
// The result type and first argument type are constant across all
// these operators. The second argument must be exactly void*.
- return (proto->getArgType(1).getCanonicalType() == Context.VoidPtrTy);
+ return (proto->getParamType(1).getCanonicalType() == Context.VoidPtrTy);
}
static bool isNamespaceStd(const DeclContext *DC) {
@@ -2342,17 +2343,17 @@ bool FunctionDecl::isReplaceableGlobalAllocationFunction() const {
return false;
const FunctionProtoType *FPT = getType()->castAs<FunctionProtoType>();
- if (FPT->getNumArgs() > 2 || FPT->isVariadic())
+ if (FPT->getNumParams() > 2 || FPT->isVariadic())
return false;
// If this is a single-parameter function, it must be a replaceable global
// allocation or deallocation function.
- if (FPT->getNumArgs() == 1)
+ if (FPT->getNumParams() == 1)
return true;
// Otherwise, we're looking for a second parameter whose type is
// 'const std::nothrow_t &', or, in C++1y, 'std::size_t'.
- QualType Ty = FPT->getArgType(1);
+ QualType Ty = FPT->getParamType(1);
ASTContext &Ctx = getASTContext();
if (Ctx.getLangOpts().SizedDeallocation &&
Ctx.hasSameType(Ty, Ctx.getSizeType()))
@@ -2385,7 +2386,7 @@ FunctionDecl::getCorrespondingUnsizedGlobalDeallocationFunction() const {
return 0;
if (getNumParams() != 2 || isVariadic() ||
- !Ctx.hasSameType(getType()->castAs<FunctionProtoType>()->getArgType(1),
+ !Ctx.hasSameType(getType()->castAs<FunctionProtoType>()->getParamType(1),
Ctx.getSizeType()))
return 0;
@@ -2517,7 +2518,7 @@ unsigned FunctionDecl::getBuiltinID() const {
/// after it has been created.
unsigned FunctionDecl::getNumParams() const {
const FunctionProtoType *FPT = getType()->getAs<FunctionProtoType>();
- return FPT ? FPT->getNumArgs() : 0;
+ return FPT ? FPT->getNumParams() : 0;
}
void FunctionDecl::setParams(ASTContext &C,
OpenPOWER on IntegriCloud