Skip to content
Snippets Groups Projects
Commit 870600d6 authored by Ted Kremenek's avatar Ted Kremenek
Browse files

Only serialize top-level decls that appear at the head of a decl chain.

llvm-svn: 44438
parent ffa55112
No related branches found
No related tags found
No related merge requests found
...@@ -128,18 +128,23 @@ void SerializationTest::Serialize(llvm::sys::Path& Filename, ...@@ -128,18 +128,23 @@ void SerializationTest::Serialize(llvm::sys::Path& Filename,
for (std::list<Decl*>::iterator I=Decls.begin(), E=Decls.end(); I!=E; ++I) { 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); // Only serialize the head of a decl chain. The ASTConsumer interfaces
FilePrinter->HandleTopLevelDecl(*I); // provides us with each top-level decl, including those nested in
// a decl chain, so we may be passed decls that are already serialized.
if (FunctionDecl* FD = dyn_cast<FunctionDecl>(*I)) if (!Sezr.isRegistered(*I)) {
if (FD->getBody()) { Printer->HandleTopLevelDecl(*I);
// Construct and print a CFG. FilePrinter->HandleTopLevelDecl(*I);
Janitor<CFG> cfg(CFG::buildCFG(FD->getBody()));
cfg->print(DeclPP); if (FunctionDecl* FD = dyn_cast<FunctionDecl>(*I))
} if (FD->getBody()) {
// Construct and print a CFG.
// Serialize the decl. Janitor<CFG> cfg(CFG::buildCFG(FD->getBody()));
Sezr.EmitOwnedPtr(*I); cfg->print(DeclPP);
}
// Serialize the decl.
Sezr.EmitOwnedPtr(*I);
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment