rSerge added inline comments.

================
Comment at: lib/Driver/Tools.cpp:4777-4780
@@ +4776,6 @@
+    {
+      std::string Feature(XRayInstrumentOption);
+      Feature += " on ";
+      Feature += Triple.getArchName().data();
+      D.Diag(diag::err_drv_clang_unsupported) << Feature;
+      break;
----------------
dberris wrote:
> Wouldn't something like this work better:
> 
>   D.Diag(...) << XRayInstrumentOption << " on " << Triple.getArchName();
No, it doesn't work this way.  Although `D.Diag` looks like a C++ stream 
because of overloaded `<<` operator, it works like C `printf` and 
`diag::err_drv_clang_unsupported` is like a format specifier. The latter 
specifies that only the first argument added via `operator<<` is included in 
the final message. So we have to pass in one string everything we want to say. 
And LLVM coding guidelines forbid C++ streams.


https://reviews.llvm.org/D24799



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to