[cfe-dev] Clang code instrumentation

Gabor Kozar kozargabor at fastmail.fm
Sat May 9 04:33:41 PDT 2015


Hi,

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.

---
Best regards,

Gábor 'ShdNx' Kozár http://gaborkozar.me


On Mon, Mar 23, 2015, at 16:55, milano wrote:
> Hi to all,
>
> I'm newbie to clang and like to do some code instrumentation with it.
> To instrument the statement coverage of functions i put some static
> instrumentation counter at proper code locations with AST rewriter.
>
> At the end of every file instrumenation i'd like to correct the array
> number of instrumented points individually for each file within the
> static structure which includes an array of int counters for each
> detected file. This file could be a seperate header file or may be a
> part of the instrumented file itself.
>
> Does anyone has an idea how to achieve this in clang?
>
> Thanks in advance
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/Clang-code-instrumentation-tp4044644.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _________________________________________________
> cfe-dev mailing list cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150509/9f9bf0b1/attachment.html>


More information about the cfe-dev mailing list