<div dir="ltr">On Tue, May 28, 2013 at 12:21 PM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<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"><div style="word-wrap:break-word"><div>On May 28, 2013, at 12:00 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br>


<div><blockquote type="cite"><blockquote class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


+<br>+    tg.spawn([&, index] {<br>+      if (error_code ec = targetInfo.readFile(input.getPath(), files[index])) {<br>+        diagnostics << "Failed to read file: " << input.getPath()<br>+                    << ": " << ec.message() << "\n";<br>


+        fail = true;<br>+        return;<br>+      }<br>+    });<br>+    ++index;<br></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">


<br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">


It's coming back to the other thread, but if targetInfo needs to be updated during input file parsing, parallelizing this piece of code would result in unpredictable behavior. I'm not saying that we can't paralellize this but just don't have a good idea to deal with that.</div>


</blockquote></div><br></div><div>How fast can the linker options be extracted from the file?  If fast, then one model would be to make a serialized pass over the input files just to collect linker options and update target info, then the next pass would be the parallel parsing of the input files.  </div>


</div></blockquote><div><br></div><div>For COFF it should be pretty fast; linker options are in .drectve section and extracting that section is easy. It's also true for the linker script because linker scripts are usually small. So two pass would work. That does not really resolve the point that we discussed in the another thread for library use case and reusability of targetinfo, though.</div>


</div></div></div>