<div dir="ltr"><div class="gmail_default" style="font-family:garamond,serif;font-size:small">Hi, </div><div class="gmail_default" style="font-family:garamond,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:garamond,serif;font-size:small">I am working on generating an AST for a given source code. I am using the tool Bear (<a href="https://github.com/rizsotto/Bear">https://github.com/rizsotto/Bear</a>) to capture the make commands in order to generate the compilation database. Analyzing the database I find multiple compile commands for the same source file with different arguments. Reviewing further it uses different command arguments to compile the source file. Hence for each compile command, I get different AST. I am using ClangTool::buildASTs() method to generate the ASTs.</div><div class="gmail_default" style="font-family:garamond,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:garamond,serif;font-size:small">How can I merge these multiple ASTs generated from the same code? Is it possible to just create all the AST's and create the final AST? or any other method to aggregate?</div><div class="gmail_default" style="font-family:garamond,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:garamond,serif;font-size:small">Any help in this regard is highly appreciated.</div><div class="gmail_default" style="font-family:garamond,serif;font-size:small"><br></div><div class="gmail_default" style="font-family:garamond,serif;font-size:small">Thanks!</div></div>