Re: Dumping Clang AST to a file

2019-07-09 Thread Aaron Ballman via cfe-commits
On Tue, Jul 9, 2019 at 8:11 AM Monalisa Rout via cfe-commits wrote: > > Hello, Currently I am dumping the Clang AST to the console but I want to > write it to a file. > > I have pasted the code snippet. > > bool HandleTopLevelDecl(DeclGroupRef DR) override { > for (DeclGroupRef::iterator b = DR.b

Dumping Clang AST to a file

2019-07-09 Thread Monalisa Rout via cfe-commits
Hello, Currently I am dumping the Clang AST to the console but I want to write it to a file. I have pasted the code snippet. bool HandleTopLevelDecl(DeclGroupRef DR) override { for (DeclGroupRef::iterator b = DR.begin(), e = DR.end(); b != e; ++b) { (*b)->dump(llvm::errs(), false,clang::ADOF_JSON