<rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.

This eliminates excessive rebuilds of the global module cache.


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