csmith-project / creduce

C-Reduce, a C and C++ program reducer
Other
1.47k stars 128 forks source link

binary search removal of c++ style comments #184

Closed amykhuang closed 5 years ago

amykhuang commented 5 years ago

I noticed that the comments pass often doesn't work because of some edge cases where it tries to remove non-comments (e.g. strings with urls, or // ...*/... ). So I added an extra binary search pass that removes just c++ style comments.

Removing cstyle comments seems a bit more tricky, so I didn't consider them here. It's might also contribute less to improving runtime, since they don't break up lines in topformflat like the c++ style comments do.

regehr commented 5 years ago

I'm glad you took a look at this, we may have only looked at the behavior of this pass on relatively small files

regehr commented 5 years ago

LGTM, thanks!