]> granicus.if.org Git - clang/commit
Serialization: use the PCH chain to check PCH mode
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 2 Mar 2017 17:37:11 +0000 (17:37 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 2 Mar 2017 17:37:11 +0000 (17:37 +0000)
commit9f74368da35396f99f4da2f2addcad61262c63d8
tree2241d6e1bdbbbac03aa3067ca7b747d45ff99c18
parent96b54be08e4b8421cf0c7d434524b59d0bdd3f06
Serialization: use the PCH chain to check PCH mode

When we are deciding whether we are creating a PCH or a module, we would
check if the ModuleMgr had any elements to switch into PCH mode.
However, when creating a module, the size may be 1.  This would result
in us going down the wrong path.

This was found by cross-compiling the swift standard library.  Use the
PCH chain length instead to identify the PCH mode.

Unfortunately, I have not yet been able to create a simple test case for
this, but have verified that this fixes the swift standard library
construction.

Thanks to Adrian Prantl for help and discussions with this change!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296769 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Serialization/ASTReader.cpp