[cfe-commits] [patch] rewrite-includes crash support

David Blaikie dblaikie at gmail.com
Tue Jun 26 13:54:08 PDT 2012


On Fri, Jun 22, 2012 at 4:50 PM, Chandler Carruth <chandlerc at google.com> wrote:
> Doh, sorry for missing this last patch.
>
> Looks pretty good. As discussed in person, you may want to sink the arg
> mutation below the PrintJob... Not sure.

We also discussed the possibility of avoiding mutating the original
args - did you/we end up dismissing that since we're mutating the jobs
anyway, so there's no real immutability invariant that we'd be
mantaining?

As for moving it, if it's all the same to you, I think I'll just leave
it where it is next to the point at which we raise the CCCIsCPP flag
as they seem related. (I could move all of that down below PrintJob I
suppose, though... )

> I'm concerned by the lack of test case modifications. If we don't have a
> test case yet for this, lets get one and check the filename. If we do, we
> should tighten it up to check the filename or figure out whats going on.

Agreed, but how exactly would I do that? The existing mechanism we
have for crashing clang is "#pragma clang __debug crash" which crashes
in the preprocessor. That means it crashes when crash recovery
attempts to produce the preprocessed source file. As we discussed
offline there's probably a couple of options here:

1) Transform the pragma into a special token then look for that token
in the parser & crash there. But how do we do this without adding a
test to a very hot part of the parser?

2) Add an extra -D to the preprocess execution when we're doing crash
report preprocessing so we can hide the pragma during crash recovery.

Anyone have any thoughts/preferences/other ideas on how best to test this?

- David



More information about the cfe-commits mailing list