dberris added inline comments.

> rSerge wrote in Tools.cpp:4787
> Is there any advantage over `const char* const` here?

This same value is turned into a string later on anyway. You can make it a 
std::string and std::move(...) it at the call to CmdArgs.push_back(...).

> rSerge wrote in Tools.cpp:4796
> It returns `StringRef`. `.str()` would construct a `std::string`, which seems 
> unnecessary.  Of course this piece is not performance-critical, but why not 
> to just use `operator+=` taking as the argument `const char* const`?

.data() doesn't necessarily have a null terminator.

Constructing a string out of successive +'s invoke move constructors on 
std::string, which makes it as efficient if not more efficient than growing a 
single string this way. At any rate it's much more readable if you did it in a 
single line.

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