<br><div><div>Thanks. Is `clangAnalysis` the Clang Static Analyzer ? It's a library and i check out some header files, but i do not know how to use this library. It seems there's no document about this library. I want to write a static code analyzer, to get all functions/variables and other more details information from a file.  Can you give me some more details about this ? <br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b> "David Blaikie"<dblaikie@gmail.com>;</div><div><b>Date: </b> Wed, Jan 2, 2013 03:06 AM</div><div><b>To: </b> "kevinlynx"<kevinlynx@gmail.com>; <wbr></div><div><b>Cc: </b> "cfe-dev"<cfe-dev@cs.uiuc.edu>; <wbr></div><div><b>Subject: </b> Re: [cfe-dev] what's the best way to writing a code analyzer with clang?</div></div><div><br></div>On Tue, Jan 1, 2013 at 6:28 AM, kevinlynx <kevinlynx@gmail.com> wrote:<br>> I'm writing a c/c++ code analyzer recently. I read some clang<br>> documents/tutorials. It seems there're several ways to accomplish this. And<br>> i'm using this tutorial<br>> http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang,<br>> because it's a real sample which can be get worked.<br>><br>> So my question is, is there any other better ways to do this ?<br><br>What kind of analysis are you  trying to do? Static? (if so,<br>source-to-source transformation isn't really relevant - check out the<br>Clang Static Analyzer and Anna's talk from the 2012 dev meeting)<br>Dynamic? (again, source to source transformation probably isn't what<br>you want - see how Address Sanitizer is implemented - as an LLVM IR<br>pass adding in the instrumentation/checking at that level)<br></div>