[Lldb-commits] [PATCH] D49411: Move from StringRef to std::string in the ScriptInterpreter API

David Blaikie via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 17 08:05:00 PDT 2018

dblaikie added a comment.

In https://reviews.llvm.org/D49411#1164680, @labath wrote:

> Normally this would be clearly a good thing, but the added complication here is that this function is part of a class hierarchy, and so  this way you are forcing every implementation to take a std::string, even though only one of them cares about null-termination.
> In performance-critical code, llvm would use `llvm::Twine` as an argument, which is able to avoid copies if the input string happens to be null-terminated (`toNullTerminatedStringRef`). However, this code is hardly that critical (and ScriptInterpreterPython is the only non-trivial class in the hierarchy), so I don't think it really matters what you do here.

Fair points all, Pavel - thanks for chiming in!


More information about the lldb-commits mailing list