<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 31, 2015, at 9:09 AM, Brugnoni Silvano <<a href="mailto:sbrugnon@hsr.ch" class="">sbrugnon@hsr.ch</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi all,<br class=""><br class=""> I’m working on a static analysis tool to detect low-level data races in C++ code. The analysis I’m trying to implement requires a control flow graph (CFG) of the entire program.<br class=""><br class="">I’m currently working the construction of this whole-program CFG using the Clang Static Analyzer. I’m aware that cross-translation unit IPA is not supported by the static analyzer by default. But I think it should be possible to extract the CFG of each translation unit independently using a custom checker, and then merge them together into a whole-program CFG afterwards. I plan to perform the merging and the subsequent analysis from a standalone tool based on LibTooling. This brings me to my question:<br class=""><br class="">Is it possible to run a checker from a clang standalone tool without having to compile it into clang? From what I can tell, the AnalysisConsumer, which is in charge of running the path-sensitive analyses, is located in an anonymous namespace and there is no way of passing it an additional checker to execute. I would appreciate it if you could clarify this.<br class=""><br class=""></div></blockquote><div><br class=""></div><div>We have <b class="">unsupported</b> plugins feature. You can find a very useful manual by searching cfe-dev for "<span style="font-family: 'Helvetica Neue';" class="">Tutorial for Clang Analyzer Plugins</span>".</div><br class=""><blockquote type="cite" class=""><div class="">Since I have not been able to run a checker from a clang standalone tool myself, I explored a different route: I tried to instantiate the clang::into::ExprEngine and its dependencies from within a custom FrontendAction in order to obtain the translation-unit CFG this way. However, I keep getting Segmentation Faults, and sometimes even Bus Errors when I run this program, depending on the exact code and compiler optimization settings. These Errors are probably caused by my lack of understanding of the clang code base, and I’m still investigating what is missing/wrong with my code. Still, I attached a simplified version of the program. Any advice is appreciated as well.<br class=""><br class="">Regards,<br class="">Silvano<br class=""><br class=""><span id="cid:44592E53C1F2E54EB1E6E8F0B721691E@hsr.ch"><main.cpp></span>_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@cs.uiuc.edu" class="">cfe-dev@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></body></html>