<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Sorry, yeah will look right now.<div class=""><br class=""></div><div class="">I did ‘check-lld’.  I forgot that doesn’t run the unit tests.</div><div class=""><br class=""></div><div class="">Pete<br class=""><div><blockquote type="cite" class=""><div class="">On Dec 16, 2015, at 1:06 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" class="">ruiu@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">It started failing with the following error. Can you take a look?<div class=""><pre style="" class="">-- Testing: 996 tests, 40 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: lld-Unit :: DriverTests/DriverTests/DarwinLdParserTest.llvmOptions (937 of 996)
******************** TEST 'lld-Unit :: DriverTests/DriverTests/DarwinLdParserTest.llvmOptions' FAILED ********************
Note: Google Test filter = DarwinLdParserTest.llvmOptions
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from DarwinLdParserTest
[ RUN      ] DarwinLdParserTest.llvmOptions
lld (LLVM option parsing): Unknown command line argument '-debug-only'.  Try: 'lld (LLVM option parsing) -help'
lld (LLVM option parsing): Did you mean '-debug-pass'?
lld (LLVM option parsing): Unknown command line argument 'foo'.  Try: 'lld (LLVM option parsing) -help'</pre></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Dec 16, 2015 at 12:53 PM, Pete Cooper via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: pete<br class="">
Date: Wed Dec 16 14:53:27 2015<br class="">
New Revision: 255819<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=255819&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=255819&view=rev</a><br class="">
Log:<br class="">
Move parsing of LLVM options to parse() method.<br class="">
<br class="">
We used to parse the LLVM options in Driver::link.  However, that is<br class="">
after parse() where we load files.  By moving the LLVM option handling<br class="">
earlier, we can add DEBUG() to code such as MachONormalizedFileToAtoms.cpp<br class="">
and have it enabled correctly by '-mllvm --debug'.<br class="">
<br class="">
Modified:<br class="">
    lld/trunk/include/lld/Driver/Driver.h<br class="">
    lld/trunk/lib/Driver/CoreDriver.cpp<br class="">
    lld/trunk/lib/Driver/DarwinLdDriver.cpp<br class="">
    lld/trunk/lib/Driver/Driver.cpp<br class="">
    lld/trunk/lib/Driver/GnuLdDriver.cpp<br class="">
<br class="">
Modified: lld/trunk/include/lld/Driver/Driver.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/Driver.h?rev=255819&r1=255818&r2=255819&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/Driver.h?rev=255819&r1=255818&r2=255819&view=diff</a><br class="">
==============================================================================<br class="">
--- lld/trunk/include/lld/Driver/Driver.h (original)<br class="">
+++ lld/trunk/include/lld/Driver/Driver.h Wed Dec 16 14:53:27 2015<br class="">
@@ -46,6 +46,9 @@ protected:<br class="">
   static bool link(LinkingContext &context,<br class="">
                    raw_ostream &diag = llvm::errs());<br class="">
<br class="">
+  /// Parses the LLVM options from the context.<br class="">
+  static void parseLLVMOptions(const LinkingContext &context);<br class="">
+<br class="">
 private:<br class="">
   Driver() = delete;<br class="">
 };<br class="">
<br class="">
Modified: lld/trunk/lib/Driver/CoreDriver.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CoreDriver.cpp?rev=255819&r1=255818&r2=255819&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CoreDriver.cpp?rev=255819&r1=255818&r2=255819&view=diff</a><br class="">
==============================================================================<br class="">
--- lld/trunk/lib/Driver/CoreDriver.cpp (original)<br class="">
+++ lld/trunk/lib/Driver/CoreDriver.cpp Wed Dec 16 14:53:27 2015<br class="">
@@ -159,6 +159,8 @@ bool CoreDriver::parse(llvm::ArrayRef<co<br class="">
     }<br class="">
   }<br class="">
<br class="">
+  parseLLVMOptions(ctx);<br class="">
+<br class="">
   if (ctx.getNodes().empty()) {<br class="">
     diagnostics << "No input files\n";<br class="">
     return false;<br class="">
<br class="">
Modified: lld/trunk/lib/Driver/DarwinLdDriver.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdDriver.cpp?rev=255819&r1=255818&r2=255819&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdDriver.cpp?rev=255819&r1=255818&r2=255819&view=diff</a><br class="">
==============================================================================<br class="">
--- lld/trunk/lib/Driver/DarwinLdDriver.cpp (original)<br class="">
+++ lld/trunk/lib/Driver/DarwinLdDriver.cpp Wed Dec 16 14:53:27 2015<br class="">
@@ -822,6 +822,10 @@ bool DarwinLdDriver::parse(llvm::ArrayRe<br class="">
     }<br class="">
   }<br class="">
<br class="">
+  // Parse the LLVM options before we process files in case the file handling<br class="">
+  // makes use of things like DEBUG().<br class="">
+  parseLLVMOptions(ctx);<br class="">
+<br class="">
   // Handle input files and sectcreate.<br class="">
   for (auto &arg : parsedArgs) {<br class="">
     bool upward;<br class="">
<br class="">
Modified: lld/trunk/lib/Driver/Driver.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/Driver.cpp?rev=255819&r1=255818&r2=255819&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/Driver.cpp?rev=255819&r1=255818&r2=255819&view=diff</a><br class="">
==============================================================================<br class="">
--- lld/trunk/lib/Driver/Driver.cpp (original)<br class="">
+++ lld/trunk/lib/Driver/Driver.cpp Wed Dec 16 14:53:27 2015<br class="">
@@ -64,8 +64,7 @@ FileVector loadFile(LinkingContext &ctx,<br class="">
   return files;<br class="">
 }<br class="">
<br class="">
-/// This is where the link is actually performed.<br class="">
-bool Driver::link(LinkingContext &ctx, raw_ostream &diagnostics) {<br class="">
+void Driver::parseLLVMOptions(const LinkingContext &ctx) {<br class="">
   // Honor -mllvm<br class="">
   if (!ctx.llvmOptions().empty()) {<br class="">
     unsigned numArgs = ctx.llvmOptions().size();<br class="">
@@ -76,6 +75,10 @@ bool Driver::link(LinkingContext &ctx, r<br class="">
     args[numArgs + 1] = nullptr;<br class="">
     llvm::cl::ParseCommandLineOptions(numArgs + 1, args);<br class="">
   }<br class="">
+}<br class="">
+<br class="">
+/// This is where the link is actually performed.<br class="">
+bool Driver::link(LinkingContext &ctx, raw_ostream &diagnostics) {<br class="">
   if (ctx.getNodes().empty())<br class="">
     return false;<br class="">
<br class="">
<br class="">
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=255819&r1=255818&r2=255819&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=255819&r1=255818&r2=255819&view=diff</a><br class="">
==============================================================================<br class="">
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)<br class="">
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Wed Dec 16 14:53:27 2015<br class="">
@@ -637,6 +637,10 @@ bool GnuLdDriver::parse(llvm::ArrayRef<c<br class="">
   if (ctx->allowLinkWithDynamicLibraries())<br class="">
     ctx->registry().addSupportELFDynamicSharedObjects(*ctx);<br class="">
<br class="">
+  // Parse the LLVM options before we process files in case the file handling<br class="">
+  // makes use of things like DEBUG().<br class="">
+  parseLLVMOptions(*ctx);<br class="">
+<br class="">
   std::stack<int> groupStack;<br class="">
   int numfiles = 0;<br class="">
   bool asNeeded = false;<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>