Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."

llvm-svn: 230454
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 58a5f98..bfb1efe 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -914,20 +914,13 @@
   unsigned &Hash;
   std::vector<Decl *> TopLevelDecls;
   PrecompilePreambleAction *Action;
-  raw_ostream *Out;
-  SmallVectorImpl<char> *SerializedASTBuffer;
 
 public:
   PrecompilePreambleConsumer(ASTUnit &Unit, PrecompilePreambleAction *Action,
                              const Preprocessor &PP, StringRef isysroot,
                              raw_ostream *Out)
-    : PCHGenerator(PP, "", nullptr, isysroot, /*AllowASTWithErrors=*/true),
-      Unit(Unit), Hash(Unit.getCurrentTopLevelHashValue()), Action(Action),
-      Out(Out) {
-    RegisterSerializationFinishedCallback(
-      [&](SmallVectorImpl<char> *Buf){
-        SerializedASTBuffer = Buf;
-      });
+    : PCHGenerator(PP, "", nullptr, isysroot, Out, /*AllowASTWithErrors=*/true),
+      Unit(Unit), Hash(Unit.getCurrentTopLevelHashValue()), Action(Action) {
     Hash = 0;
   }
 
@@ -948,13 +941,6 @@
   void HandleTranslationUnit(ASTContext &Ctx) override {
     PCHGenerator::HandleTranslationUnit(Ctx);
     if (hasEmittedPCH()) {
-      // Write the generated bitstream to "Out".
-      Out->write((char *)&SerializedASTBuffer->front(),
-                 SerializedASTBuffer->size());
-      // Make sure it hits disk now.
-      Out->flush();
-      SerializedASTBuffer->clear();
-
       // Translate the top-level declarations we captured during
       // parsing into declaration IDs in the precompiled
       // preamble. This will allow us to deserialize those top-level