<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 21, 2015 at 3:40 PM, Teresa Johnson <span dir="ltr"><<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@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 Wed, Oct 21, 2015 at 3:01 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
><br>
> On Wed, Oct 21, 2015 at 2:52 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com">tejohnson@google.com</a>><br>
> wrote:<br>
>><br>
>> On Wed, Oct 21, 2015 at 12:49 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>><br>
>> wrote:<br>
>> ><br>
>> ><br>
>> > On Wed, Oct 21, 2015 at 12:33 PM, Aaron Ballman via llvm-commits<br>
>> > <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> >><br>
>> >> On Wed, Oct 21, 2015 at 3:25 PM, Teresa Johnson via llvm-commits<br>
>> >> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> >> > Author: tejohnson<br>
>> >> > Date: Wed Oct 21 14:25:14 2015<br>
>> >> > New Revision: 250929<br>
>> >> ><br>
>> >> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=250929&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=250929&view=rev</a><br>
>> >> > Log:<br>
>> >> > Silence Visual C++ warning in function summary parsing code (NFC)<br>
>> >> ><br>
>> >> > Modified:<br>
>> >> >     llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
>> >> ><br>
>> >> > Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp<br>
>> >> > URL:<br>
>> >> ><br>
>> >> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=250929&r1=250928&r2=250929&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=250929&r1=250928&r2=250929&view=diff</a><br>
>> >> ><br>
>> >> ><br>
>> >> > ==============================================================================<br>
>> >> > --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)<br>
>> >> > +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed Oct 21<br>
>> >> > 14:25:14<br>
>> >> > 2015<br>
>> >> > @@ -5538,6 +5538,7 @@ std::error_code FunctionIndexBitcodeRead<br>
>> >> >    // importing is added so that it can be tested.<br>
>> >> >    SmallVector<uint64_t, 64> Record;<br>
>> >> >    switch (Stream.readRecord(Entry.ID, Record)) {<br>
>> >> > +    case bitc::FS_CODE_COMBINED_ENTRY:<br>
>> >> >      default:<br>
>> >> >        return error("Invalid record");<br>
>> >><br>
>> >> What warning is this silencing?<br>
>><br>
>> BitcodeReader.cpp(5543): warning C4065: switch statement contains<br>
>> 'default' but no 'case' labels.<br>
>><br>
>> >> It seems like the correct approach is<br>
>> >> to remove the switch entirely.<br>
>> ><br>
>> ><br>
>> > +1 - this looks like it should just be:<br>
>> ><br>
>> > if (Stream.readRecord(...))<br>
>> >   return error(...);<br>
>><br>
>> I could do that too, it is currently a placeholder for a TODO when the<br>
>> full ThinLTO pipeline is hooked up. The comment just above is:<br>
>><br>
>>   // TODO: Read a record. This interface will be completed when ThinLTO<br>
>>   // importing is added so that it can be tested.<br>
>><br>
>> Eventually it will parse FS_CODE_COMBINED_ENTRY records. If there is a<br>
>> strong preference to remove this as Aaron suggested, I can do that<br>
>> though.<br>
><br>
><br>
> *shrug* not too fussed (& my suggestion's wrong too, of course, I guess it<br>
> should be "Stream.readRecord(Entry.ID, Record); return error("Invalid<br>
> record");" - no if/condition/control flow/etc), but probably wouldn't hurt<br>
> to just strip out the placeholder code for now and leave the FIXME to<br>
> describe where this code is going.<br>
><br>
> *looks at the code some more*<br>
> So this function is called currently, but always fails? Is that<br>
> tested/useful? (I'm sure it was all reviewed by people with far more context<br>
> than me when it went in, so don't let me derail you or anything - I'm just a<br>
> tad confused at first glance)<br>
<br>
</div></div>It is currently reached from an interface in lib/Object that is not<br>
yet used, to support lazy parsing of function summary data. I have<br>
some code out for review in D13515 that uses the greedy parsing<br>
interface for tests via llvm-link, but I didn't flesh this one out<br>
completely since I didn't add a call yet for the lazy parsing (I<br>
expect there to be tradeoffs and I'm not yet sure which approach will<br>
win overall). So that's why I sketched out most of the support in this<br>
routine but I didn't fill in the record handling yet. I'd prefer to<br>
leave most of this in since I expect to add calls to it as well. Let<br>
me know if that seems reasonable though!<br></blockquote><div><br>I'll defer to the judgment of your original code reviewers (which is to say, it was reviewed/signed off, so I'm not going to suggest changing that now if this was all clear in the original review)<br><br>Just for myself, I'm a bit more hard-line about not committing untested/unexercised code (because it makes it hard to tell that it's properly tested - if it's not tested in the original commit it's not easy to tell that it needs to be considered in the test matrix when the code does become live (usually I only look at the new code to ensure /that/ is tested, rather than that it lights up a whole bunch of dormant/untested code in the process))<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Teresa<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
>><br>
>><br>
>> Teresa<br>
>><br>
>> ><br>
>> >><br>
>> >><br>
>> >> ~Aaron<br>
>> >><br>
>> >> >    }<br>
>> >> ><br>
>> >> ><br>
>> >> > _______________________________________________<br>
>> >> > llvm-commits mailing list<br>
>> >> > <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
>> >> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
>> >> _______________________________________________<br>
>> >> llvm-commits mailing list<br>
>> >> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
>> >> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Teresa Johnson | Software Engineer | <a href="mailto:tejohnson@google.com">tejohnson@google.com</a> | <a href="tel:408-460-2413" value="+14084602413">408-460-2413</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Teresa Johnson | Software Engineer | <a href="mailto:tejohnson@google.com">tejohnson@google.com</a> | <a href="tel:408-460-2413" value="+14084602413">408-460-2413</a><br>
</div></div></blockquote></div><br></div></div>