Index: lib/Serialization/ModuleManager.cpp =================================================================== --- lib/Serialization/ModuleManager.cpp +++ lib/Serialization/ModuleManager.cpp @@ -363,19 +363,6 @@ VisitState *State = allocateVisitState(); unsigned VisitNumber = State->NextVisitNumber++; - - // If the caller has provided us with a hit-set that came from the global - // module index, mark every module file in common with the global module - // index that is *not* in that set as 'visited'. - if (ModuleFilesHit && !ModulesInCommonWithGlobalIndex.empty()) { - for (unsigned I = 0, N = ModulesInCommonWithGlobalIndex.size(); I != N; ++I) - { - ModuleFile *M = ModulesInCommonWithGlobalIndex[I]; - if (!ModuleFilesHit->count(M)) - State->VisitNumber[M->Index] = VisitNumber; - } - } - for (unsigned I = 0, N = VisitOrder.size(); I != N; ++I) { ModuleFile *CurrentModule = VisitOrder[I]; // Should we skip this module file? Index: test/Modules/Inputs/builtins/a.h =================================================================== --- /dev/null +++ test/Modules/Inputs/builtins/a.h @@ -0,0 +1,3 @@ +#include +@interface A +@end Index: test/Modules/Inputs/builtins/b.h =================================================================== --- /dev/null +++ test/Modules/Inputs/builtins/b.h @@ -0,0 +1,3 @@ +#include "a.h" +@interface B : A +@end Index: test/Modules/Inputs/builtins/module.modulemap =================================================================== --- /dev/null +++ test/Modules/Inputs/builtins/module.modulemap @@ -0,0 +1,7 @@ +module A { + header "a.h" +} + +module B { + header "b.h" +} Index: test/Modules/builtins-incremental.m =================================================================== --- /dev/null +++ test/Modules/builtins-incremental.m @@ -0,0 +1,28 @@ +// RUN: rm -rf %T/cache %T/cache1 %T/cache2 +// +// Build B which imports A. +// RUN: %clang_cc1 -cc1 -fsyntax-only -fmodules -fimplicit-module-maps \ +// RUN: -fmodules-cache-path=%T/cache -fdisable-module-hash \ +// RUN: -I %S/Inputs/builtins %s +// RUN: mv %T/cache %T/cache1 +// +// Build only A. +// RUN: echo '@import A;' >%t.m +// RUN: %clang_cc1 -cc1 -fsyntax-only -fmodules -fimplicit-module-maps \ +// RUN: -fmodules-cache-path=%T/cache -fdisable-module-hash \ +// RUN: -I %S/Inputs/builtins %t.m +// +// Incrementally build B which imports A. +// RUN: %clang_cc1 -cc1 -fsyntax-only -fmodules -fimplicit-module-maps \ +// RUN: -fmodules-cache-path=%T/cache -fdisable-module-hash \ +// RUN: -I %S/Inputs/builtins %s +// RUN: mv %T/cache %T/cache2 +// +// RUN: llvm-bcanalyzer %T/cache1/B.pcm >%t.dump +// RUN: llvm-bcanalyzer %T/cache2/B.pcm >>%t.dump +// RUN: cat %t.dump | FileCheck %s + +// Verify the identifier table has the same size in both versions of B.pcm: +// CHECK: 1 [[INDENT_SIZE:[0-9]+]] 100.00 IDENTIFIER_TABLE +// CHECK: 1 [[INDENT_SIZE]] 100.00 IDENTIFIER_TABLE +@import B;