[lld] r264945 - Remove useless unreachable. Switch coverage already gives us this. NFC

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 18:22:34 PDT 2016


> On Mar 30, 2016, at 6:21 PM, Sean Silva <chisophugis at gmail.com> wrote:
> 
> 
> 
> On Wed, Mar 30, 2016 at 3:43 PM, Pete Cooper via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Hmm, i was sure I’ve seen us elide unreachable’s in similar situations before.  Happy to revert though if GCC isn’t going to like this.
> 
> I think we generally put them afterwards like it was: http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations <http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations>I’d been waiting to see if a bot complained (they haven’t), but i’m not going to argue with the coding standards.

Will revert this one.  Thanks for pointing out the relevant part of the standard.

Pete
> 
> -- Sean Silva
>  
> 
> Cheers,
> Pete
> 
>> On Mar 30, 2016, at 3:42 PM, David Blaikie <dblaikie at gmail.com <mailto:dblaikie at gmail.com>> wrote:
>> 
>> This is usually needed to suppress GCC's -Wreturn-type warning.
>> 
>> On Wed, Mar 30, 2016 at 3:34 PM, Pete Cooper via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
>> Author: pete
>> Date: Wed Mar 30 17:34:37 2016
>> New Revision: 264945
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=264945&view=rev <http://llvm.org/viewvc/llvm-project?rev=264945&view=rev>
>> Log:
>> Remove useless unreachable.  Switch coverage already gives us this.  NFC
>> 
>> Modified:
>>     lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
>> 
>> Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp?rev=264945&r1=264944&r2=264945&view=diff <http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp?rev=264945&r1=264944&r2=264945&view=diff>
>> ==============================================================================
>> --- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp (original)
>> +++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp Wed Mar 30 17:34:37 2016
>> @@ -865,7 +865,6 @@ std::error_code Util::getSymbolTableRegi
>>      }
>>      break;
>>    }
>> -  llvm_unreachable("atom->scope() unknown enum value");
>>  }
>> 
>>  std::error_code Util::addSymbols(const lld::File &atomFile,
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>
>> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <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/20160330/4ceebf3d/attachment.html>


More information about the llvm-commits mailing list