Fix crash with -serialize (reported to cfe-dev). The issue was 
essentially that we were destroying the declarations twice.

(Note that we don't use -serialize directly in the testsuite, only 
SerializeTest.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51768 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp
index 3383dd3..ba9fc90 100644
--- a/Driver/ASTConsumers.cpp
+++ b/Driver/ASTConsumers.cpp
@@ -879,6 +879,7 @@
   
   virtual void Initialize(ASTContext &Context) {
     if (!TU) TU = new TranslationUnit(Context, lang);
+    TU->SetOwnsDecls(false);
   }
   
   virtual void HandleTopLevelDecl(Decl *D) {