[cfe-commits] r146644 - in /cfe/trunk: include/clang/AST/DeclObjC.h include/clang/Serialization/ASTReader.h lib/AST/ASTImporter.cpp lib/AST/DeclObjC.cpp lib/AST/DeclPrinter.cpp lib/Sema/SemaCodeComplete.cpp lib/Sema/SemaDeclObjC.cpp lib/Sema/Sema

Douglas Gregor dgregor at apple.com
Thu Dec 15 08:54:30 PST 2011


On Dec 15, 2011, at 3:59 AM, Francois Pichet wrote:

> On Thu, Dec 15, 2011 at 12:27 AM, Douglas Gregor <dgregor at apple.com> wrote:
>> Author: dgregor
>> Date: Wed Dec 14 23:27:12 2011
>> New Revision: 146644
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=146644&view=rev
>> Log:
>> Move the definition-specific data of ObjCInterfaceDecl into a
>> separately-allocated DefinitionData structure, which we manage the
>> same way as CXXRecordDecl::DefinitionData. This prepares the way for
>> making ObjCInterfaceDecls redeclarable, to more accurately model
>> forward declarations of Objective-C classes and eliminate the mutation
>> of ObjCInterfaceDecl that causes us serious trouble in the AST reader.
>> 
>> Note that ObjCInterfaceDecl's accessors are fairly robust against
>> being applied to forward declarations, because Clang (and Sema in
>> particular) doesn't perform RequireCompleteType/hasDefinition() checks
>> everywhere it has to. Each of these overly-robust cases is marked with
>> a FIXME, which we can tackle over time.
>> 
>> 
>> 
>> Modified:
>>    cfe/trunk/include/clang/AST/DeclObjC.h
>>    cfe/trunk/include/clang/Serialization/ASTReader.h
>>    cfe/trunk/lib/AST/ASTImporter.cpp
>>    cfe/trunk/lib/AST/DeclObjC.cpp
>>    cfe/trunk/lib/AST/DeclPrinter.cpp
>>    cfe/trunk/lib/Sema/SemaCodeComplete.cpp
>>    cfe/trunk/lib/Sema/SemaDeclObjC.cpp
>>    cfe/trunk/lib/Sema/SemaExprObjC.cpp
>>    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
>>    cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
>>    cfe/trunk/tools/libclang/IndexingContext.cpp
>> 
>>  void ObjCInterfaceDecl::LoadExternalDefinition() const {
>> -  assert(ExternallyCompleted && "Class is not externally completed");
>> -  ExternallyCompleted = false;
>> +  assert(data().ExternallyCompleted && "Class is not externally completed");
>> +  data().ExternallyCompleted = false;
>>   getASTContext().getExternalSource()->CompleteType(
>>                                         const_cast<ObjCInterfaceDecl *>(this));
>>  }
> 
> Hi Doug, this revision is causing a huge regression on MSVC where
> virtually every objc tests is failing.
> 
> I used to debugger to pointing the problem: For some reason
>    getASTContext().getExternalSource() in LoadExternalDefinition()
> return a null pointer on MSVC.

Should be fixed in r146658, thanks!

	- Doug



More information about the cfe-commits mailing list