diff options
author | John McCall <rjmccall@apple.com> | 2011-10-07 06:10:15 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-10-07 06:10:15 +0000 |
commit | 5e1cdac63c3d9c9b32fa41fa0b2d242a58a20d49 (patch) | |
tree | 4315635ba5c4741bce2150f06e162dd4ca99b98a /lib/AST/Decl.cpp | |
parent | 856ebfb6357042d46052ccb39c1fbb490718320e (diff) |
Rename TagDecl::isDefinition -> isCompleteDefinition
for better self-documenting code, since the semantics
are subtly different from getDefinition().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 9870c8ea6b..9e6947d5e3 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -2271,22 +2271,22 @@ void TagDecl::completeDefinition() { cast<CXXRecordDecl>(this)->hasDefinition()) && "definition completed but not started"); - IsDefinition = true; + IsCompleteDefinition = true; IsBeingDefined = false; if (ASTMutationListener *L = getASTMutationListener()) L->CompletedTagDefinition(this); } -TagDecl* TagDecl::getDefinition() const { - if (isDefinition()) +TagDecl *TagDecl::getDefinition() const { + if (isCompleteDefinition()) return const_cast<TagDecl *>(this); if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(this)) return CXXRD->getDefinition(); for (redecl_iterator R = redecls_begin(), REnd = redecls_end(); R != REnd; ++R) - if (R->isDefinition()) + if (R->isCompleteDefinition()) return *R; return 0; @@ -2348,7 +2348,7 @@ void EnumDecl::completeDefinition(QualType NewType, QualType NewPromotionType, unsigned NumPositiveBits, unsigned NumNegativeBits) { - assert(!isDefinition() && "Cannot redefine enums!"); + assert(!isCompleteDefinition() && "Cannot redefine enums!"); if (!IntegerType) IntegerType = NewType.getTypePtr(); PromotionType = NewPromotionType; @@ -2401,7 +2401,7 @@ RecordDecl::field_iterator RecordDecl::field_begin() const { /// completeDefinition - Notes that the definition of this type is now /// complete. void RecordDecl::completeDefinition() { - assert(!isDefinition() && "Cannot redefine record!"); + assert(!isCompleteDefinition() && "Cannot redefine record!"); TagDecl::completeDefinition(); } |