Any idea on that? I just cannot find a way of using GIMPLE to analyze
multiple .C files. All my analysis is still start from the following
function:

virtual unsigned int execute(function *fun) override

which has no idea about the .C file information. In LLVM all .C files are
roughly maintained in separate "modules" but I just don't know how to
access such information in GIMPLE.

Best,
Shuai

On Thu, Jun 25, 2020 at 4:07 PM Shuai Wang <wangshuai...@gmail.com> wrote:

> Hello,
>
> I am working on a basic block coverage counter which
> mimics -fsanitize-coverage=trace-pc but has more features. My problem is
> that when instrumenting multiple C files (e.g., test1.c test2.c test3.c), I
> want to generate correspondingly three coverage logs (test1.log, test2.log,
> test3.log), so on and so forth.
>
> Therefore, my question is 1) how to figure out the instrumented source
> code file name in GIMPLE plugins (my plugins is after the "optimized"
> pass), and 2) I want to keep all covered basic block info in memory and
> write log file *only once* right before finish the profiling (i.e., the
> instrumented program finish executing the program and is about to exit).
> Can I somehow set a callback at that point and then flush the coverage
> record into files? I don't know how/where to "set a callback" like that, if
> possible at all.
>
> Thank you very much.
>
> Best,
> Shuai
>

Reply via email to