Don't emit protocol conformance cross-references for conformances owned by Clang modules.

Swift SVN r20828
This commit is contained in:
Doug Gregor
2014-07-31 15:59:01 +00:00
parent c7a5b1daca
commit 2b59a39ccf

View File

@@ -788,7 +788,11 @@ Serializer::writeConformance(const ProtocolDecl *protocol,
auto conf = cast<NormalProtocolConformance>(conformance);
// If the conformance comes from another module, write a reference to it.
if (conformance->getDeclContext()->getParentModule() != M) {
// We don't do this for Clang modules because there might not be
// anywhere to store the conformance. It will simply be regenerated.
if (conformance->getDeclContext()->getParentModule() != M &&
!ClangModuleUnit::hasClangModule(
conformance->getDeclContext()->getParentModule())) {
unsigned abbrCode = abbrCodes[XRefProtocolConformanceLayout::Code];
DeclID protoID = addDeclRef(conf->getProtocol());
DeclID typeID = addDeclRef(conf->getType()->getAnyNominal());