PCH + module: make sure we write out macros associated with builtin identifiers.

When we import a module that defines a builtin identifier from prefix header and
precompile the prefix header, the macro information related to the identifier
is lost.

If we don't precompile the prefix header, the source file can still see the
macro information. The reason is that we write out the identifier in the pch
but not the macro information since the macro is not defined locally.

This is related to r251565. In that commit, if we read a builtin identifier from
a module that wasn't "interesting" to that module, we will still write it out to
a PCH that imports that module.

The fix is to write exported module macros for PCH as well.

rdar://24666630

Differential Revision: http://reviews.llvm.org/D20383


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271310 91177308-0d34-0410-b5e6-96231b3b80d8
5 files changed