On Mon, Apr 21, 2014 at 7:20 PM, Alp Toker <[email protected]> wrote:

>
>> @@ -1084,15 +1100,22 @@
>>     return DB;
>>   }
>>   -inline DiagnosticBuilder DiagnosticsEngine::Report(SourceLocation Loc,
>> -                                                   unsigned DiagID) {
>> +inline DiagnosticBuilder
>> +DiagnosticsEngine::Report(SourceLocation Loc, unsigned DiagID,
>> StringRef Val) {
>>     assert(CurDiagID == ~0U && "Multiple diagnostics in flight at once!");
>>     CurDiagLoc = Loc;
>>     CurDiagID = DiagID;
>> +  FlagNameValue = Val.str();
>>     return DiagnosticBuilder(this);
>>   }
>>
>
> Did you consider adding a DiagnosticBuilder function to append a
> FlagNameValue instead of all this?
>
> That would reduce the impact of your patch and improve readability in the
> callers. Something like:
>
>   Diag(Loc, ID).extendFlag("=mypass") << D;
>

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.

I'm not really opposed to the idea, though. I just found the current
version easier to use.


Diego.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to