diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-22 00:34:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-22 00:34:07 +0000 |
commit | 9e9199d8649cf3e10c98a69403f05dbb666d8fb1 (patch) | |
tree | 5051ff7f4e0191e7d7dc9606c698986689483526 /lib/AST/DeclCXX.cpp | |
parent | 0d6d12b2db47ff34d6cd30917992a8c8ad97aac2 (diff) |
Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, since the context is available in the Decl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclCXX.cpp')
-rw-r--r-- | lib/AST/DeclCXX.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 986b81c0f8..bbbb19a35b 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -164,8 +164,7 @@ CXXConstructorDecl *CXXRecordDecl::getCopyConstructor(ASTContext &Context, if (isa<FunctionTemplateDecl>(*Con)) continue; - if (cast<CXXConstructorDecl>(*Con)->isCopyConstructor(Context, - FoundTQs)) { + if (cast<CXXConstructorDecl>(*Con)->isCopyConstructor(FoundTQs)) { if (((TypeQuals & Qualifiers::Const) == (FoundTQs & Qualifiers::Const)) || (!(TypeQuals & Qualifiers::Const) && (FoundTQs & Qualifiers::Const))) return cast<CXXConstructorDecl>(*Con); @@ -246,7 +245,7 @@ CXXRecordDecl::addedConstructor(ASTContext &Context, // Note when we have a user-declared copy constructor, which will // suppress the implicit declaration of a copy constructor. - if (ConDecl->isCopyConstructor(Context)) { + if (ConDecl->isCopyConstructor()) { UserDeclaredCopyConstructor = true; // C++ [class.copy]p6: @@ -757,8 +756,7 @@ bool CXXConstructorDecl::isDefaultConstructor() const { } bool -CXXConstructorDecl::isCopyConstructor(ASTContext &Context, - unsigned &TypeQuals) const { +CXXConstructorDecl::isCopyConstructor(unsigned &TypeQuals) const { // C++ [class.copy]p2: // A non-template constructor for class X is a copy constructor // if its first parameter is of type X&, const X&, volatile X& or @@ -779,6 +777,8 @@ CXXConstructorDecl::isCopyConstructor(ASTContext &Context, return false; // Is it a reference to our class type? + ASTContext &Context = getASTContext(); + CanQualType PointeeType = Context.getCanonicalType(ParamRefType->getPointeeType()); CanQualType ClassTy |