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

Shankar Easwaran shankare at codeaurora.org
Mon Oct 20 05:18:32 PDT 2014


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 ?

Thanks for the review, Renato.

Shankar Easwaran

-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by the Linux Foundation



More information about the llvm-commits mailing list