Go to file
Graydon Hoare e0a68355f2 [ASTReader] Treat multiple defns of ObjC protocols the same as interfaces.
Summary:
In change 2ba19793512, the ASTReader logic for ObjC interfaces was modified to
preserve the first definition-data read, "merging" later definitions into it
rather than overwriting it (though this "merging" is, in practice, a no-op that
discards the later definition-data).

Unfortunately this change was only made to ObjC interfaces, not protocols; this
means that when (for example) loading a protocol that references an interface,
if both the protocol and interface are multiply defined (as can easily happen
if the same header is read from multiple contexts), an _inconsistent_ pair of
definitions is loaded: first-read for the interface and last-read for the
protocol.

This in turn causes very subtle downstream bugs in the Swift ClangImporter,
which filters the results of name lookups based on the owning module of a
definition; inconsistency between a pair of related definitions causes name
lookup failures at various stages of compilation.

To fix these downstream issues, this change replicates the logic applied to
interfaces in change 2ba19793512, but for ObjC protocols.

rdar://30851899

Reviewers: doug.gregor, rsmith

Reviewed By: doug.gregor

Subscribers: jordan_rose, cfe-commits

Differential Revision: https://reviews.llvm.org/D34741

llvm-svn: 306583
2017-06-28 18:36:27 +00:00
clang [ASTReader] Treat multiple defns of ObjC protocols the same as interfaces. 2017-06-28 18:36:27 +00:00
clang-tools-extra [clangd] Add "Go to Declaration" functionality 2017-06-28 16:12:10 +00:00
compiler-rt [PGO] Reduce IO in profile dumping with merging 2017-06-28 16:46:06 +00:00
debuginfo-tests Add a test for PR33166. 2017-05-25 19:33:16 +00:00
libclc generic: add missing get_work_dim include 2017-06-02 15:58:35 +00:00
libcxx Updated notest on 2974 2017-06-28 18:19:34 +00:00
libcxxabi Add some catch(...) blocks to the tests so that if they fail, we get a good error message. No functional change. 2017-06-22 00:49:03 +00:00
libunwind [libunwind] Add _LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS 2017-06-27 18:37:06 +00:00
lld [COFF] Allow debug info to relocate against discarded symbols 2017-06-28 17:06:35 +00:00
lldb [DWARFCallFrameInfo] Add Type enum to differentiate eh/debug_frame sections 2017-06-28 09:09:19 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm Reuse existing variable. NFC. 2017-06-28 18:24:02 +00:00
openmp Make test/parallel/omp_nested.c not use so many threads 2017-06-27 03:04:25 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Heap allocation for new arrays. 2017-06-28 13:02:43 +00:00