<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 21, 2014 at 7:20 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank" class="cremed">alp@nuanti.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
@@ -1084,15 +1100,22 @@<br>
    return DB;<br>
  }<br>
  -inline DiagnosticBuilder DiagnosticsEngine::Report(<u></u>SourceLocation Loc,<br>
-                                                   unsigned DiagID) {<br>
+inline DiagnosticBuilder<br>
+DiagnosticsEngine::Report(<u></u>SourceLocation Loc, unsigned DiagID, StringRef Val) {<br>
    assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!");<br>
    CurDiagLoc = Loc;<br>
    CurDiagID = DiagID;<br>
+  FlagNameValue = Val.str();<br>
    return DiagnosticBuilder(this);<br>
  }<br>
</blockquote>
<br>
Did you consider adding a DiagnosticBuilder function to append a FlagNameValue instead of all this?<br>
<br>
That would reduce the impact of your patch and improve readability in the callers. Something like:<br>
<br>
  Diag(Loc, ID).extendFlag("=mypass") << D;<br></blockquote><div><br></div><div>Yeah, briefly. But it seemed to involve more typing, so I had a slight preference over the shorter version. It would also mean resetting the flag name after each call.</div>
<div><br></div><div>I'm not really opposed to the idea, though. I just found the current version easier to use.</div><div><br></div><div><br></div><div>Diego.</div></div></div></div>