<div class="gmail_quote">On Sun, May 6, 2012 at 10:12 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Sat, May 5, 2012 at 12:24 PM, Matthieu Monrocq<br>
<<a href="mailto:matthieu.monrocq@gmail.com">matthieu.monrocq@gmail.com</a>> wrote:<br>
> On Fri, May 4, 2012 at 10:30 PM, Manuel Klimek <<a href="mailto:klimek@google.com">klimek@google.com</a>> wrote:<br>
>><br>
>> On Fri, May 4, 2012 at 9:56 PM, Simon Atanasyan <<a href="mailto:satanasyan@mips.com">satanasyan@mips.com</a>><br>
>> wrote:<br>
>> > On Fri, May 4, 2012 at 7:39 PM, Manuel Klimek <<a href="mailto:klimek@google.com">klimek@google.com</a>> wrote:<br>
>> >> I haven't put too much thought into the interface yet, but I'd imagine<br>
>> >> something along the lines of<br>
>> >> class ArgumentAdjuster {<br>
>> >> public:<br>
>> >>  vector<std::string> Adjust(const vector<std::string> &Arguments) = 0;<br>
>> >> };<br>
>> >><br>
>> >> class ClangSyntaxOnlyAdjuster : public ArgumentAdjuster { ... };<br>
>> >><br>
>> >> Then, for people who have command lines that are for gcc for some<br>
>> >> reasons:<br>
>> >> class GccToClangAdjuster : public ArgumentAdjuster { ... };<br>
>> >><br>
>> >> Then we can install a ClangSyntaxOnlyAdjuster per default and add a<br>
>> >> method to ClangTool:<br>
>> >> void setArgumentAdjuster(ArgumentAdjuster *Adjuster);<br>
>> >><br>
>> >> I think the argument adjusting is orthogonal to the tool, so I'd<br>
>> >> rather avoid inheritance on the ClangTool level.<br>
>> ><br>
>> > Now I see your point and like this approach. I will implement and send<br>
>> > a patch for review.<br>
>><br>
>> Thx! Looking forward to it :)<br>
>><br>
><br>
> It always bothered me a bit, so since this is going to be adjusted...<br>
><br>
> Is there a fundamental reason to reason in terms of `string` here ?<br>
><br>
> Or more accurately, I understand that parsing the command line requires<br>
> strings in input, but why should it produce strings in output, instead of a<br>
> more canonical form ?<br>
<br>
</div></div>Do you have a proposal what you mean with a 'more canonical form' here?</blockquote><div><br></div><div>Some of the refactoring that James and I have been talking about to the driver would directly enabled this -- specifically modeling everything as serialization and deserialization of options using the table-generated parsers.</div>
<div><br></div><div>Given such a model, you could use the driver to load the arguments, manipulate them, and even if you needed to write them back out in textual form, do so.</div><div><br></div><div>Any baby steps we can take in that direction seem good. </div>
</div>