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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jul 25 09:19:06 PDT 2013


This looks like an overkill. Cant we go directly form argv to a list
of Inputs? An input in this context is one of

* A plain object file
* An archive, with some simple boolean options (load all elements)
* A group (which is a list of other inputs)
* A begin-lib/end-lib "area".

I don't see where we need a general graph structure.


On 25 July 2013 12:06, Shankar Kalpathi Easwaran <shankarke at gmail.com> wrote:
> Hi Bigcheese, kledzik, ruiu,
>
> Before it gets too far, I thought let me get the initial work reviewed to process command line arguments into a Graph form.
>
> The functionality addresses Command line arguments by creating a Graph which contains InputElements. The InputElements are nodes that contain InputFile information or Control Information.
>
> The InputFile information in addition to containing a file, contains positional options that deal with this InputFile.
> For example --force-load libc.a --no-force-load (We only want to force load libc.a and no other libraries).
>
> The Control information is another kind of InputElement which  contains information on how the resolver would need to deal with (For example : --start-group, --end-group).
>
> The InputElements that are part of the InputGraph also has two additional fields
>
> a) Ordinal (The ordinal value sets the order of the InputElement in the graph)
> b) Weight (Associates a weight to the InputElement). Could be used to get statistics.
>
> The global options are still dealt with by placing them in TargetInfo as earlier. If we want to change this, I will accomodate to any changes in design.
>
> Still todo functionalities :-
>
> a) Address review comments
> b) Add tests
> b) Add functionality to dump the InputGraph to Text/YAML.
> c) Add functionality to validate
> d) Expand an input element
>
> More importantly the FileNode needs to be attached to lld Core functionality so that lld can query for flavor specific options when it deals with individual files.
>
> What I have done till now is
>
> Changed the ELF flavor to create InputGraph nodes and populate options and convert all the regular options that deal with.
>
> http://llvm-reviews.chandlerc.com/D1217
>
> Files:
>   include/lld/Driver/ELFInputGraph.h
>   include/lld/Driver/InputGraph.h
>   lib/Driver/CMakeLists.txt
>   lib/Driver/ELFInputGraph.cpp
>   lib/Driver/GnuLdDriver.cpp
>   lib/Driver/InputGraph.cpp
>   lib/Driver/LDOptions.td
>
> _______________________________________________
> 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