Avoid invalidating successfully loaded module files
authorBen Langmuir <blangmuir@apple.com>
Fri, 20 Jun 2014 00:24:56 +0000 (00:24 +0000)
committerBen Langmuir <blangmuir@apple.com>
Fri, 20 Jun 2014 00:24:56 +0000 (00:24 +0000)
commit9801b253ad3be9d9151e78e738115fa7725db7ff
tree40c20e00bcd7930f74093dce2a82fbea5396516b
parent577508df831184a5123aaa6a6cb510becdcd3440
Avoid invalidating successfully loaded module files

Successfully loaded module files may be referenced in other
ModuleManagers, so don't invalidate them. Two related things are fixed:

1) I thought the last module in the manager was always the one that
failed, but it isn't.  So check explicitly against the list of
vetted modules from ReadASTCore.

2) We now keep the file descriptor of pcm file open, which avoids the
possibility of having two different pcms for the same module loaded when
building in parallel with headers being modified during a build.

<rdar://problem/16835846>

llvm-svn: 211330
clang/include/clang/Basic/FileManager.h
clang/include/clang/Serialization/ModuleManager.h
clang/lib/Basic/FileManager.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ModuleManager.cpp