[llvm] r250929 - Silence Visual C++ warning in function summary parsing code (NFC)

Yaron Keren via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 13:37:21 PDT 2015


The warning was BitcodeReader.cpp(5543): warning C4065: switch statement
contains 'default' but no 'case' labels.
The switch appears to be a placeholder, the comment above says:

  // TODO: Read a record. This interface will be completed when ThinLTO
  // importing is added so that it can be tested.



2015-10-21 22:49 GMT+03:00 David Blaikie via llvm-commits <
llvm-commits at lists.llvm.org>:

>
>
> On Wed, Oct 21, 2015 at 12:33 PM, Aaron Ballman via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> On Wed, Oct 21, 2015 at 3:25 PM, Teresa Johnson via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>> > Author: tejohnson
>> > Date: Wed Oct 21 14:25:14 2015
>> > New Revision: 250929
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=250929&view=rev
>> > Log:
>> > Silence Visual C++ warning in function summary parsing code (NFC)
>> >
>> > Modified:
>> >     llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
>> >
>> > Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
>> > URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=250929&r1=250928&r2=250929&view=diff
>> >
>> ==============================================================================
>> > --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
>> > +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed Oct 21 14:25:14
>> 2015
>> > @@ -5538,6 +5538,7 @@ std::error_code FunctionIndexBitcodeRead
>> >    // importing is added so that it can be tested.
>> >    SmallVector<uint64_t, 64> Record;
>> >    switch (Stream.readRecord(Entry.ID, Record)) {
>> > +    case bitc::FS_CODE_COMBINED_ENTRY:
>> >      default:
>> >        return error("Invalid record");
>>
>> What warning is this silencing? It seems like the correct approach is
>> to remove the switch entirely.
>>
>
> +1 - this looks like it should just be:
>
> if (Stream.readRecord(...))
>   return error(...);
>
>
>>
>> ~Aaron
>>
>> >    }
>> >
>> >
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151021/1ee2e615/attachment.html>


More information about the llvm-commits mailing list