[lld] r220182 - [ELF] Check for target architecture.

Simon Atanasyan simon at atanasyan.com
Mon Oct 20 07:13:48 PDT 2014


On Mon, Oct 20, 2014 at 4:18 PM, Shankar Easwaran
<shankare at codeaurora.org> wrote:
> On 10/20/2014 6:50 AM, Renato Golin wrote:
>>
>> On 20 October 2014 12:40, Shankar Easwaram <shankarke at gmail.com> wrote:
>>>
>>> I agree that it would be simpler to add all the functionality in the
>>> parent class which is the ELFObjectReader, but i think it's much cleaner and
>>> flexible with each elf subtarget own what all in the elf header to check.
>>
>> Moving the generic part to a parent class doesn't preclude you from
>> adding extra bits on the children.
>>
>> For instance:
>>
>> if (ARM.specificStuff())
>>    return ARM.specificTest();
>>
>> return  ELFObjectReader::canParse(...);
>
>
> Currently the base ELFObjectReader doesnot know anything about the
> subtarget, adding a field in the base class with all the relevant
> information of the target in whichever way or form we need to check could be
> done.
>
> This would avoid code duplication.
>
> Simon ?

Good point. Let's go this way.

-- 
Simon Atanasyan



More information about the llvm-commits mailing list