Hi Konstantin-
How about just reducing the non-preprocessed file first, then preprocess
it, then reduce again?
The first line-delta pass should delete all unnecessary include
directives...
Overall we've reduced very few big C++ testcases. My own intuition, at
least, isn't very strong for these.
Can you give us some ideas about how long C-Reduce is taking for you?
If it's really slow this will help motivate me to work on this. Also,
how easy is it for us to build the compiler that you are testing? If
you give us a few large C++ testcases + repro instructions it should be
easy enough to do some performance engineering.
John
On 6/24/12 5:02 AM, Konstantin Tokarev wrote:
Hi all,
As you may know, there is a clang-based tool "Include What You Use" [1]. I
think similar approach could be useful in C-Reduce to remove whole header files instead
of separate lines. Though I'm not sure it's feasible without non-preprocessed source file
and compilation command line available.
I can imagine the next algorithm of reduction:
1. Reduce only the last section of translation unit corresponding to original
source file without #includes using all available passes.
2. Try to remove sections corresponding to "unused" headers
3. Move to section N-1 and proceed.
Assuming that "interesting" fragment of code is located in sections with big
numbers (source file and local headers) while first sections contain library headers,
this approach might be more efficient than traditional line-based reduction.
[1] http://code.google.com/p/include-what-you-use