Unbreak SerializationTest and the Rewriter by doing the work in HandleTranslationUnit instead of the destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54513 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp
index 408860e..59a77e7 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -108,7 +108,10 @@
     void HandleDeclInMainFile(Decl *D);
     RewriteObjC(std::string inFile, std::string outFile,
                 Diagnostic &D, const LangOptions &LOpts);
-    ~RewriteObjC();
+
+    ~RewriteObjC() {}
+    
+    virtual void HandleTranslationUnit(TranslationUnit& TU);
     
     void ReplaceStmt(Stmt *Old, Stmt *New) {
       // If replacement succeeded or warning disabled return with no warning.
@@ -439,7 +442,7 @@
   // Nothing yet.
 }
 
-RewriteObjC::~RewriteObjC() {
+void RewriteObjC::HandleTranslationUnit(TranslationUnit& TU) {
   // Get the top-level buffer that this corresponds to.
   
   // Rewrite tabs if we care.