<div dir="ltr">On Fri, Aug 30, 2013 at 8:25 PM, Shankar Kalpathi Easwaran <span dir="ltr"><<a href="mailto:shankarke@gmail.com" target="_blank">shankarke@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  When you try to parse the directive section, you are calling the Driver to parse and set various options, isnt it ?<br>
  I think you could add to the list of inputs at the time when you are called then right ?<br></blockquote><div><br></div><div>Yes, I call WinLinkDriver to parse command line options, but that's only to parse options. I don't call Driver::link or any other function in Driver. Because driver for each flavor does not handle and cannot access inputFiles now, I cannot add new input files to inputFiles during linking.</div>

<div><br></div><div>I think the real problem is that Driver::link is doing too much things in one function; it creates 1) a list of input file objects from list of input file names, 3) link them, 3) run passes, and 4) output a resulting file. If we want to add a new file in the middle of that process, it's not easy to do, because it does not allow us to run only step 1.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  The problem with handling it outside the driver is you have to create the actual input file, It might be a library or .obj, without an extension and so forth. The InputGraph nodes already deal with that kind of complexity.<br>


<br>
  I am not certain on this is the way, we want to do this change though.<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1569" target="_blank">http://llvm-reviews.chandlerc.com/D1569</a><br>
</blockquote></div><br></div></div>