From 507eb87f05bf20310ebb24e2ddb7b5517f909a62 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 22 Dec 2009 00:34:07 +0000 Subject: Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl llvm-svn: 91862 --- clang/lib/Sema/SemaDecl.cpp | 2 +- clang/lib/Sema/SemaDeclCXX.cpp | 4 ++-- clang/lib/Sema/SemaExpr.cpp | 2 +- clang/lib/Sema/SemaInit.cpp | 2 +- clang/lib/Sema/SemaOverload.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index d83f8527486..a1792651302 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -800,7 +800,7 @@ static Sema::CXXSpecialMember getSpecialMember(ASTContext &Ctx, if (const CXXConstructorDecl *Ctor = dyn_cast(MD)) { if (Ctor->isDefaultConstructor()) return Sema::CXXDefaultConstructor; - if (Ctor->isCopyConstructor(Ctx)) + if (Ctor->isCopyConstructor()) return Sema::CXXCopyConstructor; } diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 7343e9f2e73..1f3fbba629e 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -3732,7 +3732,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation, CXXConstructorDecl *CopyConstructor, unsigned TypeQuals) { assert((CopyConstructor->isImplicit() && - CopyConstructor->isCopyConstructor(Context, TypeQuals) && + CopyConstructor->isCopyConstructor(TypeQuals) && !CopyConstructor->isUsed()) && "DefineImplicitCopyConstructor - call it for implicit copy ctor"); @@ -3784,7 +3784,7 @@ Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType, // all, even if the class copy constructor or destructor have side effects. // FIXME: Is this enough? - if (Constructor->isCopyConstructor(Context)) { + if (Constructor->isCopyConstructor()) { Expr *E = ((Expr **)ExprArgs.get())[0]; if (ImplicitCastExpr *ICE = dyn_cast(E)) if (ICE->getCastKind() == CastExpr::CK_NoOp) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index f67a7a6bb9d..f8afd0f33e4 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -7011,7 +7011,7 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) { if (!Constructor->isUsed()) DefineImplicitDefaultConstructor(Loc, Constructor); } else if (Constructor->isImplicit() && - Constructor->isCopyConstructor(Context, TypeQuals)) { + Constructor->isCopyConstructor(TypeQuals)) { if (!Constructor->isUsed()) DefineImplicitCopyConstructor(Loc, Constructor, TypeQuals); } diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 2a27466a55e..3ff25883565 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -3096,7 +3096,7 @@ static Sema::OwningExprResult CopyIfRequiredForEntity(Sema &S, // Find the constructor (which may be a template). CXXConstructorDecl *Constructor = dyn_cast(*Con); if (!Constructor || Constructor->isInvalidDecl() || - !Constructor->isCopyConstructor(S.Context)) + !Constructor->isCopyConstructor()) continue; S.AddOverloadCandidate(Constructor, &CurInitExpr, 1, CandidateSet); diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 66aa4845b12..8236ad7eecb 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -451,7 +451,7 @@ Sema::TryImplicitConversion(Expr* From, QualType ToType, QualType FromCanon = Context.getCanonicalType(From->getType().getUnqualifiedType()); QualType ToCanon = Context.getCanonicalType(ToType).getUnqualifiedType(); - if (Constructor->isCopyConstructor(Context) && + if (Constructor->isCopyConstructor() && (FromCanon == ToCanon || IsDerivedFrom(FromCanon, ToCanon))) { // Turn this into a "standard" conversion sequence, so that it // gets ranked with standard conversion sequences. -- cgit v1.2.3