<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Hi,<br></div>
<div> </div>
<div>What problems are you specifically looking at? It's not clear from your e-mail what the difficulty is. You can insert arbitrary text to the source code using clang::Rewriter, and get any clang::SourceLocation-s from the AST nodes and clang::SourceManager.<br></div>
<div> </div>
<div id="sig19426265"><div class="signature">---<br></div>
<div class="signature">Best regards,<br></div>
<div class="signature"> </div>
<div class="signature">Gábor 'ShdNx' Kozár<br></div>
<div class="signature"><a href="http://gaborkozar.me">http://gaborkozar.me</a><br></div>
</div>
<div> </div>
<div> </div>
<div>On Mon, Mar 23, 2015, at 16:55, milano wrote:<br></div>
<blockquote type="cite"><div>Hi to all,<br></div>
<div> </div>
<div>I'm newbie to clang and like to do some code instrumentation with it.<br></div>
<div>To instrument the statement coverage of functions i put some static<br></div>
<div>instrumentation counter<br></div>
<div>at proper code locations with AST rewriter.<br></div>
<div> </div>
<div>At the end of every file instrumenation i'd like to correct the array<br></div>
<div>number<br></div>
<div>of instrumented points<br></div>
<div>individually for each file within the static structure which includes an<br></div>
<div>array of int counters for each<br></div>
<div>detected file. This file could be a seperate header file or may be a part<br></div>
<div>of<br></div>
<div>the instrumented file itself.<br></div>
<div> </div>
<div>Does anyone has an idea how to achieve this in clang?<br></div>
<div> </div>
<div>Thanks in advance<br></div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>--<br></div>
<div>View this message in context:<br></div>
<div><a href="http://clang-developers.42468.n3.nabble.com/Clang-code-instrumentation-tp4044644.html">http://clang-developers.42468.n3.nabble.com/Clang-code-instrumentation-tp4044644.html</a><br></div>
<div>Sent from the Clang Developers mailing list archive at Nabble.com.<br></div>
<div><u>_______________________________________________</u><br></div>
<div>cfe-dev mailing list<br></div>
<div><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br></div>
<div><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></div>
</blockquote><div> </div>
</body>
</html>