[PATCH] D27604: [Driver] Add compiler option to generate a reproducer

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 11 11:59:08 PDT 2017


rsmith accepted this revision.
rsmith added a comment.

LGTM with one change.



================
Comment at: include/clang/Basic/DiagnosticDriverKinds.td:95
 def err_drv_force_crash : Error<
-  "failing because environment variable '%0' is set">;
+  "failing because %select{environment variable|option}0 '%1' is set">;
 def err_drv_invalid_mfloat_abi : Error<
----------------
mehdi_amini wrote:
> Is it worth it? What about `"failing because %1 is set">;`
> 
> And then later:
> 
> ```
> Diags.Report(diag::err_drv_force_crash) << "option '-gen-reproducer'";
> ```
Even though we don't have translations for our diagnostics, it's intended that they be translatable, so you should not hardcode strings like "option " and "environment variable " in the code. Use a %select here instead, maybe? (See http://clang.llvm.org/docs/InternalsManual.html#the-format-string)


https://reviews.llvm.org/D27604





More information about the cfe-commits mailing list