Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22091

Use GIMPLE plugin to analyze multiple .C files

$
0
0

I am working on my GIMPLE plugin to count basic block-level coverage info. Currently it works well for single .C file. Basically it 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) within a project, I want to generate correspondingly three coverage logs (test1.log, test2.log, test3.log), so on and so forth.

Therefore, my question is how to figure out the instrumented source code file name in GIMPLE plugins (my plugins is after the "optimized" pass)? I just cannot find a way of using GIMPLE to analyze multiple .C files. All my analysis starts from the following function:

virtual unsigned int execute(function *fun)

which has no view about the .C file information. In LLVM all .C files are maintained in separate modules but I just don't know how to access such information in GIMPLE. To my surprise, I cannot find any related information from the GIMPLE functionstruct. I was expecting to see a "pointer" or somewhat point to a higher-level data struct (something like module or so).


Viewing all articles
Browse latest Browse all 22091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>