[PATCH] [lld] add InputGraph to process Command line arguments

Shankar Easwaran shankare at codeaurora.org
Thu Jul 25 10:26:20 PDT 2013


Hi,

The reason I put in the 'parent' pointer for the InputElement was only 
for convenience. If there is no need of that functionality I will remove 
that functionality.

With that functionality removed, InputGraph is no more a Graph, and it 
would change to InputList.

I will wait for the rename / removing parent until more reviewers comment.

Thanks

Shankar Easwaran

On 7/25/2013 12:00 PM, Rafael EspĂ­ndola wrote:
> On 25 July 2013 12:43, Shankar Easwaran <shankare at codeaurora.org> wrote:
>> Hi Rafael,
>>
>> The current implementation / design handles like how you mentioned but
>> Inputs need to know to what group do they belong for how to process them.
>> The InputElement as part of each control node, has a parent associated with
>> it.
>>
>> In the below example :-
>>
>> lld main.o --start-group libc.a libma --as-needed libpthread.so
>> --no-as-needed --end-group -o a.out
>>
>> libc.a libm.a are part of a group and that information would be needed when
>> you process the group.
> We need to represent a group. The group has to have a list of
> libraries in it (or, as an optimization, it can have the actual
> members of those libraries). When selecting which members of a group
> (i.e., the individual .o files) are to be added to the link, we should
> have the group at hand, so I don't think we even need a member or an
> archive to link to the group.
>
> In summary, I think we can use an api like
>
> addObjectFIleToLink(...) // add a .o to the link unconditionally.
> addArchiveToLink() //Walk the archive members and add those that
> satisfy a currently undefined symbol
> addBeginEndLibToLink() // Similar, but add a set of files from a
> --begin-lib/--end-lib
> addGroupToLink()// The difference in here is that this function
> iterates over the archive members until no member is added to the
> link.
>
>> May be the name needs to be changed ... I am open for suggestions.
>>
>> Thanks
>>
>> Shankar Easwaran
>>
> Cheers,
> Rafael
>
>


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




More information about the llvm-commits mailing list