]> granicus.if.org Git - clang/commitdiff
Rename TagDecl::isDefinition -> isCompleteDefinition
authorJohn McCall <rjmccall@apple.com>
Fri, 7 Oct 2011 06:10:15 +0000 (06:10 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 7 Oct 2011 06:10:15 +0000 (06:10 +0000)
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

25 files changed:
include/clang/AST/Decl.h
include/clang/AST/TypeLoc.h
lib/AST/ASTImporter.cpp
lib/AST/Decl.cpp
lib/AST/DeclPrinter.cpp
lib/AST/RecordLayoutBuilder.cpp
lib/AST/Type.cpp
lib/AST/VTableBuilder.cpp
lib/CodeGen/CGRTTI.cpp
lib/CodeGen/CodeGenTypes.cpp
lib/Frontend/ASTConsumers.cpp
lib/Rewrite/RewriteObjC.cpp
lib/Sema/SemaCXXScopeSpec.cpp
lib/Sema/SemaChecking.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaLookup.cpp
lib/Sema/SemaType.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriter.cpp
lib/Serialization/ASTWriterDecl.cpp
lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp
lib/StaticAnalyzer/Core/MemRegion.cpp
lib/StaticAnalyzer/Core/RegionStore.cpp
tools/libclang/CIndex.cpp

index 76aad219462c16c4c26253e0b9070d8ed5c71f73..0f65bfbd356583634c6eeba244f9f6aea3e2100f 100644 (file)
@@ -2359,9 +2359,10 @@ private:
   /// TagDeclKind - The TagKind enum.
   unsigned TagDeclKind : 2;
 
-  /// IsDefinition - True if this is a definition ("struct foo {};"), false if
-  /// it is a declaration ("struct foo;").
-  bool IsDefinition : 1;
+  /// IsCompleteDefinition - True if this is a definition ("struct foo
+  /// {};"), false if it is a declaration ("struct foo;").  It is not
+  /// a definition until the definition has been fully processed.
+  bool IsCompleteDefinition : 1;
 
   /// IsBeingDefined - True if this is currently being defined.
   bool IsBeingDefined : 1;
@@ -2421,7 +2422,7 @@ protected:
     assert((DK != Enum || TK == TTK_Enum) &&
            "EnumDecl not matched with TTK_Enum");
     TagDeclKind = TK;
-    IsDefinition = false;
+    IsCompleteDefinition = false;
     IsBeingDefined = false;
     IsEmbeddedInDeclarator = false;
     IsFreeStanding = false;
@@ -2463,14 +2464,15 @@ public:
   }
 
   /// isThisDeclarationADefinition() - Return true if this declaration
-  /// defines the type.  Provided for consistency.
+  /// is a completion definintion of the type.  Provided for consistency.
   bool isThisDeclarationADefinition() const {
-    return isDefinition();
+    return isCompleteDefinition();
   }
 
-  /// isDefinition - Return true if this decl has its body specified.
-  bool isDefinition() const {
-    return IsDefinition;
+  /// isCompleteDefinition - Return true if this decl has its body
+  /// fully specified.
+  bool isCompleteDefinition() const {
+    return IsCompleteDefinition;
   }
 
   /// isBeingDefined - Return true if this decl is currently being defined.
@@ -2504,14 +2506,15 @@ public:
 
   /// getDefinition - Returns the TagDecl that actually defines this
   ///  struct/union/class/enum.  When determining whether or not a
-  ///  struct/union/class/enum is completely defined, one should use this method
-  ///  as opposed to 'isDefinition'.  'isDefinition' indicates whether or not a
-  ///  specific TagDecl is defining declaration, not whether or not the
-  ///  struct/union/class/enum type is defined.  This method returns NULL if
-  ///  there is no TagDecl that defines the struct/union/class/enum.
-  TagDecl* getDefinition() const;
+  ///  struct/union/class/enum has a definition, one should use this
+  ///  method as opposed to 'isDefinition'.  'isDefinition' indicates
+  ///  whether or not a specific TagDecl is defining declaration, not
+  ///  whether or not the struct/union/class/enum type is defined.
+  ///  This method returns NULL if there is no TagDecl that defines
+  ///  the struct/union/class/enum.
+  TagDecl *getDefinition() const;
 
-  void setDefinition(bool V) { IsDefinition = V; }
+  void setCompleteDefinition(bool V) { IsCompleteDefinition = V; }
 
   const char *getKindName() const {
     return TypeWithKeyword::getTagTypeKindName(getTagKind());
@@ -2751,7 +2754,7 @@ public:
 
   /// \brief Returns true if this can be considered a complete type.
   bool isComplete() const {
-    return isDefinition() || isFixed();
+    return isCompleteDefinition() || isFixed();
   }
 
   /// \brief Returns the enumeration (declared within the template)
@@ -2854,14 +2857,15 @@ public:
   /// \endcode
   bool isInjectedClassName() const;
 
-  /// getDefinition - Returns the RecordDecl that actually defines this
-  ///  struct/union/class.  When determining whether or not a struct/union/class
-  ///  is completely defined, one should use this method as opposed to
-  ///  'isDefinition'.  'isDefinition' indicates whether or not a specific
-  ///  RecordDecl is defining declaration, not whether or not the record
-  ///  type is defined.  This method returns NULL if there is no RecordDecl
-  ///  that defines the struct/union/tag.
-  RecordDecl* getDefinition() const {
+  /// getDefinition - Returns the RecordDecl that actually defines
+  ///  this struct/union/class.  When determining whether or not a
+  ///  struct/union/class is completely defined, one should use this
+  ///  method as opposed to 'isCompleteDefinition'.
+  ///  'isCompleteDefinition' indicates whether or not a specific
+  ///  RecordDecl is a completed definition, not whether or not the
+  ///  record type is defined.  This method returns NULL if there is
+  ///  no RecordDecl that defines the struct/union/tag.
+  RecordDecl *getDefinition() const {
     return cast_or_null<RecordDecl>(TagDecl::getDefinition());
   }
 
index 02ced65e5c58a87219197e7c00d94cdc910d48d1..20acadab7cf76769ade6fb06ec18fa6aedd0f54e 100644 (file)
@@ -568,7 +568,7 @@ public:
 
   /// \brief True if the tag was defined in this type specifier. 
   bool isDefinition() const {
-    return getDecl()->isDefinition() &&
+    return getDecl()->isCompleteDefinition() &&
          (getNameLoc().isInvalid() || getNameLoc() == getDecl()->getLocation());
   }
 };
index e95d01a98fb738de6ce262735779cb18a275ea9a..050a9ab2c65a66bb20ca2efb20e16f75a2af4acb 100644 (file)
@@ -2233,7 +2233,7 @@ Decl *ASTNodeImporter::VisitEnumDecl(EnumDecl *D) {
   D2->setIntegerType(ToIntegerType);
   
   // Import the definition
-  if (D->isDefinition() && ImportDefinition(D, D2))
+  if (D->isCompleteDefinition() && ImportDefinition(D, D2))
     return 0;
 
   return D2;
@@ -2286,7 +2286,7 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) {
       
       if (RecordDecl *FoundRecord = dyn_cast<RecordDecl>(Found)) {
         if (RecordDecl *FoundDef = FoundRecord->getDefinition()) {
-          if (!D->isDefinition() || IsStructuralMatch(D, FoundDef)) {
+          if (!D->isCompleteDefinition() || IsStructuralMatch(D, FoundDef)) {
             // The record types structurally match, or the "from" translation
             // unit only had a forward declaration anyway; call it the same
             // function.
@@ -2334,7 +2334,7 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) {
   
   Importer.Imported(D, D2);
 
-  if (D->isDefinition() && ImportDefinition(D, D2))
+  if (D->isCompleteDefinition() && ImportDefinition(D, D2))
     return 0;
   
   return D2;
@@ -3713,7 +3713,8 @@ Decl *ASTNodeImporter::VisitClassTemplateDecl(ClassTemplateDecl *D) {
   Importer.Imported(D, D2);
   Importer.Imported(DTemplated, D2Templated);
 
-  if (DTemplated->isDefinition() && !D2Templated->isDefinition()) {
+  if (DTemplated->isCompleteDefinition() &&
+      !D2Templated->isCompleteDefinition()) {
     // FIXME: Import definition!
   }
   
@@ -3775,7 +3776,7 @@ Decl *ASTNodeImporter::VisitClassTemplateSpecializationDecl(
     // FIXME: Check for specialization vs. instantiation errors.
     
     if (RecordDecl *FoundDef = D2->getDefinition()) {
-      if (!D->isDefinition() || IsStructuralMatch(D, FoundDef)) {
+      if (!D->isCompleteDefinition() || IsStructuralMatch(D, FoundDef)) {
         // The record types structurally match, or the "from" translation
         // unit only had a forward declaration anyway; call it the same
         // function.
@@ -3805,7 +3806,7 @@ Decl *ASTNodeImporter::VisitClassTemplateSpecializationDecl(
   }
   Importer.Imported(D, D2);
   
-  if (D->isDefinition() && ImportDefinition(D, D2))
+  if (D->isCompleteDefinition() && ImportDefinition(D, D2))
     return 0;
   
   return D2;
index 9870c8ea6bc5cd2b57c6d3babd2e44d2a9df673e..9e6947d5e3ab3e09e52e6329b45327169591d63b 100644 (file)
@@ -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);
 }
 
-TagDeclTagDecl::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();
 }
 
index 7c61bae9ad1a7abd22af7b1e692b2b41090c0b0b..73f5cdb12223e846842050e52c16188d5fd20fe7 100644 (file)
@@ -141,7 +141,7 @@ void Decl::printGroup(Decl** Begin, unsigned NumDecls,
     ++Begin;
 
   PrintingPolicy SubPolicy(Policy);
-  if (TD && TD->isDefinition()) {
+  if (TD && TD->isCompleteDefinition()) {
     TD->print(Out, Policy, Indentation);
     Out << " ";
     SubPolicy.SuppressTag = true;
@@ -345,7 +345,7 @@ void DeclPrinter::VisitEnumDecl(EnumDecl *D) {
     Out << " : " << Underlying;
   }
 
-  if (D->isDefinition()) {
+  if (D->isCompleteDefinition()) {
     Out << " {\n";
     VisitDeclContext(D);
     Indent() << "}";
@@ -359,7 +359,7 @@ void DeclPrinter::VisitRecordDecl(RecordDecl *D) {
   if (D->getIdentifier())
     Out << ' ' << D;
 
-  if (D->isDefinition()) {
+  if (D->isCompleteDefinition()) {
     Out << " {\n";
     VisitDeclContext(D);
     Indent() << "}";
@@ -670,7 +670,7 @@ void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) {
   if (D->getIdentifier())
     Out << ' ' << D;
 
-  if (D->isDefinition()) {
+  if (D->isCompleteDefinition()) {
     // Print the base classes
     if (D->getNumBases()) {
       Out << " : ";
index 369ebec3ddf748e011ec9256bdb08682abf78cdf..f351d76d76dbd1b2e96ebb26e58115b07e6cb85f 100644 (file)
@@ -2013,7 +2013,7 @@ ASTContext::getASTRecordLayout(const RecordDecl *D) const {
   // until we *finish* parsing the definition.
   D = D->getDefinition();
   assert(D && "Cannot get layout of forward declarations!");
-  assert(D->isDefinition() && "Cannot layout type before complete!");
+  assert(D->isCompleteDefinition() && "Cannot layout type before complete!");
 
   // Look up this layout, if already laid out, return what we have.
   // Note that we can't save a reference to the entry because this function
index 60cb3fa33e5f9232ae546d942acba080e9e888ae..0e0548db6ce92910afeb8a12c30ac8a6a0b4ee6e 100644 (file)
@@ -905,7 +905,7 @@ bool Type::isIncompleteType() const {
   case Record:
     // A tagged type (struct/union/enum/class) is incomplete if the decl is a
     // forward declaration, but not a full definition (C99 6.2.5p22).
-    return !cast<TagType>(CanonicalType)->getDecl()->isDefinition();
+    return !cast<TagType>(CanonicalType)->getDecl()->isCompleteDefinition();
   case ConstantArray:
     // An array is incomplete if its element type is incomplete
     // (C++ [dcl.array]p1).
@@ -1747,7 +1747,7 @@ static TagDecl *getInterestingTagDecl(TagDecl *decl) {
   for (TagDecl::redecl_iterator I = decl->redecls_begin(),
                                 E = decl->redecls_end();
        I != E; ++I) {
-    if (I->isDefinition() || I->isBeingDefined())
+    if (I->isCompleteDefinition() || I->isBeingDefined())
       return *I;
   }
   // If there's no definition (not even in progress), return what we have.
index 49032b49efcbf6cf924ed97b902075fd894fe8a9..7765817759a4e8f98a0910a8e2737f337db4283b 100644 (file)
@@ -2200,7 +2200,7 @@ void VTableContext::ComputeMethodVTableIndices(const CXXRecordDecl *RD) {
   const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase();
   
   if (PrimaryBase) {
-    assert(PrimaryBase->isDefinition() && 
+    assert(PrimaryBase->isCompleteDefinition() && 
            "Should have the definition decl of the primary base!");
 
     // Since the record decl shares its vtable pointer with the primary base
index 2ad1ed39303bf319b391e4affac5baaf0befa78f..dbf99fa5d76015793d7dedcbf1a8fa233d2bf318 100644 (file)
@@ -267,7 +267,7 @@ static bool ShouldUseExternalRTTIDescriptor(CodeGenModule &CGM, QualType Ty) {
 
 /// IsIncompleteClassType - Returns whether the given record type is incomplete.
 static bool IsIncompleteClassType(const RecordType *RecordTy) {
-  return !RecordTy->getDecl()->isDefinition();
+  return !RecordTy->getDecl()->isCompleteDefinition();
 }  
 
 /// ContainsIncompleteClassType - Returns whether the given type contains an
index 31aed99825a9233ec5506b7fe4ef5dfd91022699..03a15ae67ea300537611f937cd50c17c74fc22e1 100644 (file)
@@ -526,7 +526,7 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) {
 
   case Type::Enum: {
     const EnumDecl *ED = cast<EnumType>(Ty)->getDecl();
-    if (ED->isDefinition() || ED->isFixed())
+    if (ED->isCompleteDefinition() || ED->isFixed())
       return ConvertType(ED->getIntegerType());
     // Return a placeholder 'i32' type.  This can be changed later when the
     // type is defined (see UpdateCompletedType), but is likely to be the
@@ -579,7 +579,7 @@ llvm::StructType *CodeGenTypes::ConvertRecordDeclType(const RecordDecl *RD) {
   // If this is still a forward declaration, or the LLVM type is already
   // complete, there's nothing more to do.
   RD = RD->getDefinition();
-  if (RD == 0 || !RD->isDefinition() || !Ty->isOpaque())
+  if (RD == 0 || !RD->isCompleteDefinition() || !Ty->isOpaque())
     return Ty;
   
   // If converting this type would cause us to infinitely loop, don't do it!
index 15ab2f83c241c9c3fbcb4ed8a09c1a0e928259b9..6f94aaa22c0693ab2536441bee9382e3d84ab9e9 100644 (file)
@@ -123,7 +123,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
   }
   case Decl::Enum: {
     const EnumDecl* ED = cast<EnumDecl>(DC);
-    if (ED->isDefinition())
+    if (ED->isCompleteDefinition())
       Out << "[enum] ";
     else
       Out << "<enum> ";
@@ -132,7 +132,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
   }
   case Decl::Record: {
     const RecordDecl* RD = cast<RecordDecl>(DC);
-    if (RD->isDefinition())
+    if (RD->isCompleteDefinition())
       Out << "[struct] ";
     else
       Out << "<struct> ";
@@ -141,7 +141,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
   }
   case Decl::CXXRecord: {
     const CXXRecordDecl* RD = cast<CXXRecordDecl>(DC);
-    if (RD->isDefinition())
+    if (RD->isCompleteDefinition())
       Out << "[class] ";
     else
       Out << "<class> ";
index c7a567812efb085f18c58cdc54749724c468ab1a..0d83e8c975a89e954edbadec9bf500b2202559d7 100644 (file)
@@ -5979,7 +5979,7 @@ void RewriteObjC::HandleDeclInMainFile(Decl *D) {
       }
     } else if (VD->getType()->isRecordType()) {
       RecordDecl *RD = VD->getType()->getAs<RecordType>()->getDecl();
-      if (RD->isDefinition())
+      if (RD->isCompleteDefinition())
         RewriteRecordBody(RD);
     }
     if (VD->getInit()) {
@@ -6011,7 +6011,7 @@ void RewriteObjC::HandleDeclInMainFile(Decl *D) {
     return;
   }
   if (RecordDecl *RD = dyn_cast<RecordDecl>(D)) {
-    if (RD->isDefinition()) 
+    if (RD->isCompleteDefinition()) 
       RewriteRecordBody(RD);
     return;
   }
index 64c72a19d297e613d1a9e107272d6d2e51754a46..360a0404b8f4e076e328de9d5fb1e6d77f35f43b 100644 (file)
@@ -237,7 +237,7 @@ bool Sema::RequireCompleteDeclContext(CXXScopeSpec &SS,
     // until we see a definition, so awkwardly pull out this special
     // case.
     if (const EnumType *enumType = dyn_cast_or_null<EnumType>(tagType)) {
-      if (!enumType->getDecl()->isDefinition()) {
+      if (!enumType->getDecl()->isCompleteDefinition()) {
         Diag(loc, diag::err_incomplete_nested_name_spec)
           << type << SS.getRange();
         SS.SetInvalid(SS.getRange());
index c25429c9ab9d30392ebd36e0b93ea8ceb386a508..71a7ebcd1cf582418650b77c44a732996fe69dc2 100644 (file)
@@ -2592,7 +2592,7 @@ struct IntRange {
     // For enum types, use the known bit width of the enumerators.
     if (const EnumType *ET = dyn_cast<EnumType>(T)) {
       EnumDecl *Enum = ET->getDecl();
-      if (!Enum->isDefinition())
+      if (!Enum->isCompleteDefinition())
         return IntRange(C.getIntWidth(QualType(T, 0)), false);
 
       unsigned NumPositive = Enum->getNumPositiveBits();
index 3692f447b317840fe65006206f30771f14c5c605..1a80999b242fff0752390d4ad5606990040bf517 100644 (file)
@@ -2292,7 +2292,7 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
   if (RecordDecl *Record = dyn_cast_or_null<RecordDecl>(Tag)) {
     ProcessDeclAttributeList(S, Record, DS.getAttributes().getList());
     
-    if (!Record->getDeclName() && Record->isDefinition() &&
+    if (!Record->getDeclName() && Record->isCompleteDefinition() &&
         DS.getStorageClassSpec() != DeclSpec::SCS_typedef) {
       if (getLangOptions().CPlusPlus ||
           Record->getDeclContext()->isRecord())
@@ -2313,7 +2313,7 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
     // and
     //   STRUCT_TYPE;  <- where STRUCT_TYPE is a typedef struct.
     RecordDecl *Record = dyn_cast_or_null<RecordDecl>(Tag);
-    if ((Record && Record->getDeclName() && !Record->isDefinition()) ||
+    if ((Record && Record->getDeclName() && !Record->isCompleteDefinition()) ||
         (DS.getTypeSpecType() == DeclSpec::TST_typename &&
          DS.getRepAsType().get()->isStructureType())) {
       Diag(DS.getSourceRange().getBegin(), diag::ext_ms_anonymous_struct)
index 93efac0651b897614accd765a1eccc2b4ba5846b..38c0c4aef59573e2e339258a8efbcb997d22c656 100644 (file)
@@ -2449,7 +2449,7 @@ static void handleTransparentUnionAttr(Sema &S, Decl *D,
     return;
   }
 
-  if (!RD->isDefinition()) {
+  if (!RD->isCompleteDefinition()) {
     S.Diag(Attr.getLoc(),
         diag::warn_transparent_union_attribute_not_definition);
     return;
index 75da41dd7709136547e983c512c5c478cfaca828..d5bee1d0e36844e16dde7596425ac49fd967a780 100644 (file)
@@ -669,7 +669,7 @@ static bool LookupDirect(Sema &S, LookupResult &R, const DeclContext *DC) {
   //   name lookup. Instead, any conversion function templates visible in the
   //   context of the use are considered. [...]
   const CXXRecordDecl *Record = cast<CXXRecordDecl>(DC);
-  if (!Record->isDefinition())
+  if (!Record->isCompleteDefinition())
     return Found;
 
   const UnresolvedSetImpl *Unresolved = Record->getConversionFunctions();
@@ -1353,7 +1353,7 @@ bool Sema::LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx,
   // Make sure that the declaration context is complete.
   assert((!isa<TagDecl>(LookupCtx) ||
           LookupCtx->isDependentContext() ||
-          cast<TagDecl>(LookupCtx)->isDefinition() ||
+          cast<TagDecl>(LookupCtx)->isCompleteDefinition() ||
           Context.getTypeDeclType(cast<TagDecl>(LookupCtx))->getAs<TagType>()
             ->isBeingDefined()) &&
          "Declaration context must already be complete!");
index 995d767e2be5bd6f287ce2d0a316b8174441e99d..2b863a735a48bf8e73752c4658d1f2554eb96a85 100644 (file)
@@ -1841,7 +1841,7 @@ static QualType GetDeclSpecTypeForDeclarator(TypeProcessingState &state,
   }
 
   if (SemaRef.getLangOptions().CPlusPlus &&
-      OwnedTagDecl && OwnedTagDecl->isDefinition()) {
+      OwnedTagDecl && OwnedTagDecl->isCompleteDefinition()) {
     // Check the contexts where C++ forbids the declaration of a new class
     // or enumeration in a type-specifier-seq.
     switch (D.getContext()) {
@@ -2094,7 +2094,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
         // C++ [dcl.fct]p6:
         //   Types shall not be defined in return or parameter types.
         TagDecl *Tag = cast<TagDecl>(D.getDeclSpec().getRepAsDecl());
-        if (Tag->isDefinition())
+        if (Tag->isCompleteDefinition())
           S.Diag(Tag->getLocation(), diag::err_type_defined_in_result_type)
             << Context.getTypeDeclType(Tag);
       }
index beaf5f65a98ade9e98e81175d7dec8fbe1f7ccda..3e6188be4d2b7614183f8afc07e8506e3af9ef60 100644 (file)
@@ -282,7 +282,7 @@ void ASTDeclReader::VisitTagDecl(TagDecl *TD) {
   VisitRedeclarable(TD);
   TD->IdentifierNamespace = Record[Idx++];
   TD->setTagKind((TagDecl::TagKind)Record[Idx++]);
-  TD->setDefinition(Record[Idx++]);
+  TD->setCompleteDefinition(Record[Idx++]);
   TD->setEmbeddedInDeclarator(Record[Idx++]);
   TD->setFreeStanding(Record[Idx++]);
   TD->setRBraceLoc(ReadSourceLocation(Record, Idx));
@@ -977,7 +977,7 @@ void ASTDeclReader::VisitCXXRecordDecl(CXXRecordDecl *D) {
 
   // Load the key function to avoid deserializing every method so we can
   // compute it.
-  if (D->IsDefinition) {
+  if (D->IsCompleteDefinition) {
     if (CXXMethodDecl *Key = ReadDeclAs<CXXMethodDecl>(Record, Idx))
       C.KeyFunctions[D] = Key;
   }
index e648c7cd5d921abdef85f2956ee388f41c519036..b31262d375feeed89271fa269f31447732524b20 100644 (file)
@@ -3912,7 +3912,7 @@ void ASTWriter::MacroDefinitionRead(serialization::PreprocessedEntityID ID,
 }
 
 void ASTWriter::CompletedTagDefinition(const TagDecl *D) {
-  assert(D->isDefinition());
+  assert(D->isCompleteDefinition());
   assert(!WritingAST && "Already writing the AST!");
   if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) {
     // We are interested when a PCH decl is modified.
@@ -3962,7 +3962,7 @@ void ASTWriter::AddedCXXImplicitMember(const CXXRecordDecl *RD, const Decl *D) {
     return; // We are interested in lazily declared implicit methods.
 
   // A decl coming from PCH was modified.
-  assert(RD->isDefinition());
+  assert(RD->isCompleteDefinition());
   UpdateRecord &Record = DeclUpdates[RD];
   Record.push_back(UPD_CXX_ADDED_IMPLICIT_MEMBER);
   Record.push_back(reinterpret_cast<uint64_t>(D));
index c5e06d7bf492e89dd8869239707465c9f04b6ccb..9b29fa60fec9ad20fd6435f5944796a13684adb3 100644 (file)
@@ -202,7 +202,7 @@ void ASTDeclWriter::VisitTagDecl(TagDecl *D) {
   VisitRedeclarable(D);
   Record.push_back(D->getIdentifierNamespace());
   Record.push_back((unsigned)D->getTagKind()); // FIXME: stable encoding
-  Record.push_back(D->isDefinition());
+  Record.push_back(D->isCompleteDefinition());
   Record.push_back(D->isEmbeddedInDeclarator());
   Record.push_back(D->isFreeStanding());
   Writer.AddSourceLocation(D->getRBraceLoc(), Record);
@@ -914,7 +914,7 @@ void ASTDeclWriter::VisitCXXRecordDecl(CXXRecordDecl *D) {
 
   // Store the key function to avoid deserializing every method so we can
   // compute it.
-  if (D->IsDefinition)
+  if (D->IsCompleteDefinition)
     Writer.AddDeclRef(Context.getKeyFunction(D), Record);
 
   Code = serialization::DECL_CXX_RECORD;
@@ -1348,7 +1348,7 @@ void ASTWriter::WriteDeclsBlockAbbrevs() {
   // TagDecl
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));   // IdentifierNamespace
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));   // getTagKind
-  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isDefinition
+  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isCompleteDefinition
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // EmbeddedInDeclarator
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsFreeStanding
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));   // SourceLocation
@@ -1394,7 +1394,7 @@ void ASTWriter::WriteDeclsBlockAbbrevs() {
   // TagDecl
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));   // IdentifierNamespace
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));   // getTagKind
-  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isDefinition
+  Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isCompleteDefinition
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // EmbeddedInDeclarator
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // IsFreeStanding
   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));   // SourceLocation
index 1bdaa4a7fbe5698b43e558333b79aead1d592b4a..e398fcb32257e5c38532b7b864cd765d07c139b0 100644 (file)
@@ -297,7 +297,7 @@ class LLVMConventionsChecker : public Checker<
 public:
   void checkASTDecl(const CXXRecordDecl *R, AnalysisManager& mgr,
                     BugReporter &BR) const {
-    if (R->isDefinition())
+    if (R->isCompleteDefinition())
       CheckASTMemory(R, BR);
   }
 
index e4afe4329059a7dfe845dfc89f55b7d9980e6005..74c9dbe0dbda05fd290c3c548c55cf6b6c8cd104 100644 (file)
@@ -897,7 +897,7 @@ RegionOffset MemRegion::getAsOffset() const {
     case FieldRegionKind: {
       const FieldRegion *FR = cast<FieldRegion>(R);
       const RecordDecl *RD = FR->getDecl()->getParent();
-      if (!RD->isDefinition())
+      if (!RD->isCompleteDefinition())
         // We cannot compute offset for incomplete type.
         return RegionOffset(0);
       // Get the field number.
index 6d435da993e4784450f80fac9263aa9a5e8c453c..4b76cf1a3debce85fc106f8d7def0102fad0cb90 100644 (file)
@@ -1485,7 +1485,7 @@ StoreRef RegionStoreManager::BindStruct(Store store, const TypedValueRegion* R,
   const RecordType* RT = T->getAs<RecordType>();
   RecordDecl *RD = RT->getDecl();
 
-  if (!RD->isDefinition())
+  if (!RD->isCompleteDefinition())
     return StoreRef(store, *this);
 
   // Handle lazy compound values.
index 8c2776d9f812d3864bbfad072f12460799fec8ca..4610ae34baefc4a36ae23e32706ab4ba45eb1bb7 100644 (file)
@@ -1592,7 +1592,7 @@ bool CursorVisitor::VisitCXXRecordDecl(CXXRecordDecl *D) {
     if (VisitNestedNameSpecifierLoc(QualifierLoc))
       return true;
 
-  if (D->isDefinition()) {
+  if (D->isCompleteDefinition()) {
     for (CXXRecordDecl::base_class_iterator I = D->bases_begin(),
          E = D->bases_end(); I != E; ++I) {
       if (Visit(cxcursor::MakeCursorCXXBaseSpecifier(I, TU)))