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

Shankar Kalpathi Easwaran shankarke at gmail.com
Thu Jul 25 09:06:00 PDT 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1217.1.patch
Type: text/x-patch
Size: 31290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130725/6bb83a1e/attachment.bin>


More information about the llvm-commits mailing list