<div dir="ltr">Hello everybody,<div><br></div><div>I am planning in doing some research and analysis with the ASTs of swift programs and, for that reason, <b>I am trying to modify the compiler to always generate a file with the contents of the -dump-ast flag when building a project.</b> </div><div><br></div><div>However, I wanted to do this even <b>without the -dump-ast flag</b>, since it can&#39;t be used in conjunction with -emit-modules flags. This is also necessary because I&#39;m using this modified version as a custom toolchain in Xcode, so all the building process (and flags) are being handed by it.</div><div><br></div><div>Apart from the files that handles the flags (e.g.. lib/Immediate/REPL.cpp, lib/Frontend/CompilerInvocation.cpp), <b>I am having problems to find how/where the act of dumping actually starts (where the visitor to print/dump starts)</b>. From that point, I could then try to &quot;force&quot; the dumping, and change the output to a file. I am not familiar with the project nor C++, so it is being a challenge.</div><div><br></div><div>Any thoughts on how I could achieve this? Any directions on how to do it would be appreciated.</div><div><br></div><div>Thanks,</div><div>Marcel</div><div> </div></div>