]> granicus.if.org Git - clang/commit
When deserializing an Objective-C class, check whether we have another
authorDouglas Gregor <dgregor@apple.com>
Thu, 22 Dec 2011 01:48:48 +0000 (01:48 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 22 Dec 2011 01:48:48 +0000 (01:48 +0000)
commit0f75323264b93a318ac9007eb5ec5b233c444068
tree13fe13ee029358dca9ad74621005f6cc8da8d54d
parent15ce164836472bfba88b30e53aa3f6ac0fb8a95d
When deserializing an Objective-C class, check whether we have another
declaration of that same class that either came from some other module
or occurred in the translation unit loading the module. In this case,
we need to merge the two redeclaration chains immediately so that all
such declarations have the same canonical declaration in the resulting
AST (even though they don't in the module files we've imported).

Focusing on Objective-C classes until I'm happy with the design, then
I'll both (1) extend this notion to other kinds of declarations, and
(2) optimize away this extra checking when we're not dealing with
modules. For now, doing this checking for PCH files/preambles gives us
better testing coverage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147123 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Serialization/ASTReader.h
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTReaderDecl.cpp
test/Modules/Inputs/redecl-merge-left.h
test/Modules/Inputs/redecl-merge-right.h
test/Modules/redecl-merge.m