<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 23, 2010, at 12:47 AM, Nick Lewycky wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On 14 April 2010 07:44, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; position: static; z-index: auto; ">
<div style="word-wrap: break-word;"><div class="im"><div><div><br></div></div></div><div><div><div>Thanks for maintaining the current interface. Now, I think we should change that interface :)</div><div><br></div>
<div>
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.,</div>
<div><br></div><div><span style="white-space: pre;"> </span>1) -fixit changes files in-place</div><div><span style="white-space: pre;"> </span>2) -fixit=suffix puts the changes for any file "foo.c" into "foosuffix.c"; we'll mainly use this for testing, I think.</div>
</div></div></div></blockquote><div><br>How does the testsuite work with this system?<br><br>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...<br>
<br>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.<br></div></div></blockquote><div><br></div><div>How about copying %s to %t.c, then running on %t.c with -fixit=fixed and checking the resulting %t.fixed.c?</div><br><blockquote type="cite"><div class="gmail_quote"><div>Please let me know if there's something I'm missing. The patch which implements this (sans testsuite changes) is attached.<br></div></div></blockquote></div><br><div>Patch looks good, thanks!</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></body></html>