]> granicus.if.org Git - clang/commitdiff
Added pretty-printing of statements during serialization.
authorTed Kremenek <kremenek@apple.com>
Tue, 13 Nov 2007 22:56:10 +0000 (22:56 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 13 Nov 2007 22:56:10 +0000 (22:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44078 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/SerializationTest.cpp

index 4a7137db6b8f84dbb10f092d30782c8edd9c2d17..075fcba2e08c3759ba7f5c2c160a08af3f1c2371 100644 (file)
@@ -107,8 +107,15 @@ void SerializationTest::Serialize(llvm::sys::Path& Filename) {
   
   Sezr.EnterBlock(DeclBlock);
   
+  // Create a printer to "consume" our deserialized ASTS.
+  ASTConsumer* Printer = CreateASTPrinter();
+  Janitor<ASTConsumer> PrinterJanitor(Printer);
+  
   for (std::list<Decl*>::iterator I=Decls.begin(), E=Decls.end(); I!=E; ++I) {
-    llvm::cerr << "Serializing: Decl.\n";    
+    llvm::cerr << "Serializing: Decl.\n";   
+    
+    Printer->HandleTopLevelDecl(*I);
+    
     Sezr.EmitOwnedPtr(*I);
   }