[lld] r212241 - [mach-o] Fix warning on enumeration cases not handled

David Blaikie dblaikie at gmail.com
Wed Jul 2 17:40:34 PDT 2014


On Wed, Jul 2, 2014 at 5:38 PM, Nick Kledzik <kledzik at apple.com> wrote:
>
> On Jul 2, 2014, at 5:28 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> Missing test coverage for the PPC and ARM cases there?
>
> There is no support for mach-o PPC or ARM at all in lld right now.  ARM is next on my to-do list.

I tend to prefer leaving assertions in place until a codepath is
reachable/testable (and thus tested - the commit that replaces an
assertion with actual code will also include tests to exercise that
code), but up to you as to what you prefer to do here.

- Dave

>
> -Nick
>
>>
>> On Wed, Jul 2, 2014 at 5:13 PM, Nick Kledzik <kledzik at apple.com> wrote:
>>> Author: kledzik
>>> Date: Wed Jul  2 19:13:26 2014
>>> New Revision: 212241
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=212241&view=rev
>>> Log:
>>> [mach-o] Fix warning on enumeration cases not handled
>>>
>>> Modified:
>>>    lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
>>>
>>> Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp?rev=212241&r1=212240&r2=212241&view=diff
>>> ==============================================================================
>>> --- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp (original)
>>> +++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp Wed Jul  2 19:13:26 2014
>>> @@ -565,6 +565,16 @@ std::error_code convertRelocs(const Sect
>>>       case lld::MachOLinkingContext::arch_x86:
>>>         arch = Reference::KindArch::x86;
>>>         break;
>>> +      case lld::MachOLinkingContext::arch_ppc:
>>> +        arch = Reference::KindArch::PowerPC;
>>> +        break;
>>> +      case lld::MachOLinkingContext::arch_armv6:
>>> +      case lld::MachOLinkingContext::arch_armv7:
>>> +      case lld::MachOLinkingContext::arch_armv7s:
>>> +        arch = Reference::KindArch::ARM;
>>> +        break;
>>> +      case lld::MachOLinkingContext::arch_unknown:
>>> +        return make_dynamic_error_code(Twine("unknown architecture"));
>>>       }
>>>
>>>       inAtom->addReference(offsetInAtom, kind, target, addend, arch);
>>>
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list