[cfe-commits] multifile fixits

Douglas Gregor dgregor at apple.com
Fri Apr 23 08:59:31 PDT 2010


On Apr 23, 2010, at 12:47 AM, Nick Lewycky wrote:

> On 14 April 2010 07:44, Douglas Gregor <dgregor at apple.com> wrote:
> 
> Thanks for maintaining the current interface. Now, I think we should change that interface :)
> 
> The "only fix the main file" approach was me being paranoid when fix-its first went it. I think the right answer now is for -fixit to always apply changes to all of the files (in place), and to allow a file name suffix, e.g.,
> 
> 	1) -fixit changes files in-place
> 	2) -fixit=suffix puts the changes for any file "foo.c" into "foosuffix.c"; we'll mainly use this for testing, I think.
> 
> How does the testsuite work with this system?
> 
> The problem I'm having is that we can no longer run "clang -cc1 -fixit -o - | clang -verify". So we either run '-fixit' which modifies the test file in-place (no good), or we run '-fixit=fixed' which creates (for example) fixit-cxx0x.fixed.cpp. So far so good...
> 
> But we then want to check its contents somehow. To do that, I hard-code the full name of the test hard-coded (fixit-cxx0x.fixed.cpp) when what we really want is a %t style temporary file. We also need to 'RUN: rm' it afterwards, but if the test fails then we stop executing run lines and the file will be left behind.

How about copying %s to %t.c, then running on %t.c with -fixit=fixed and checking the resulting %t.fixed.c?

> Please let me know if there's something I'm missing. The patch which implements this (sans testsuite changes) is attached.

Patch looks good, thanks!

	- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100423/cfba43c4/attachment.html>


More information about the cfe-commits mailing list