[modules] Consistently construct a buffer as input to build the module.
This means the main file for modules will always be a virtual one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165591 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index cdb9646..d060e79 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -1111,7 +1111,7 @@
       return Failure;
     }
 
-    if (!DisableValidation &&
+    if (!DisableValidation && !OverriddenBuffer &&
         ((off_t)Record[4] != File->getSize()
 #if !defined(LLVM_ON_WIN32)
         // In our regression testing, the Windows file system seems to