<div dir="ltr">Hi Aaron,<div><br></div><div>According to my investigation, you can enable CTU analysis with `experimental-enable-naive-ctu-analysis=true` and `ctu-dir` parameters when executing clang.</div><div>And before your analysis, you should create the external definition mapping file with `clang-extdef-mapping` or `clang-func-mapping` (depending on your clang's version, see clang/tools/).</div><div>With the mapping file, CTU analysis can find the desired FunctionDecls outside current TU when CTU analysis is enabled.</div><div><br></div><div>An example of invoking clang with CTU analysis enabled:</div><div>```</div><div>$ clang++ -cc1 -analyze -analyzer-checker=YOUR_REQUIRED_CHECKERS -o OUTPUT_DIRECTORY/ -analyzer-config experimental-enable-naive-ctu-analysis=true -analyzer-config ctu-dir=PATH_TO_FIND_MAPPING_FILE/ FILE_TO_BE_ANALYZED.cpp</div><div>```</div><div><br></div><div>The latest version of CTU analysis is now under merging, hope there will be some official documents someday.</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Regards,</div><div>Ella</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">AAA C via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> 于2019年5月26日周日 下午2:36写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Is there a way to analyze multiple translation units / files using clang? I'm trying to implement a simple analysis to match up each function call to its potential FunctionDecls, where the decls might be defined in multiple files.</div><div><br></div><div>Thanks,</div><div>Aaron </div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>