I have finally made the easy-test-seam tool that I mentioned here: http://lists.llvm.org/pipermail/cfe-dev/2014-December/040578.html
I’m really a cpp \ llvm newbie so it was a considerable effort. I’ve borrowed ideas from the FixItRecompile functionality and used the WrapperFrontendAction class.
The easy-test-seam functionality works, the generated code is correct.
The commit can be found on github here: https://github.com/ivankoster/clang/commit/14b48590af28129ba3ffcf647274dd483d0a22dc
The only sad part is:
I’m generating the AST twice, due to the wrapper action, but the diagnostics are not printed for the 2nd AST generation. This is very unfortunate, because the first generation of the AST is almost always guaranteed to contain warnings, because of the way I designed easy-test-seam. (We’re essentially assigning a value to an identifier that is unassignable, but it becomes assignable in the 2nd generation…) And I want to suppress the first set of diagnostics, but let all the diagnostics from the 2nd generation through!
Could anyone take a look at my commit and see what I did wrong?
I’ve been looking at my code for a few hours now, but my lack of experience with the clang codebase is working against me.
Many thanks in advance!