labath added a comment.

While I appreciate the desire to reduce "boilerplate", I also think there's a 
lot of value in consistency. None of the existing APIs in llvm do anything like 
this, and are perfectly happy to call toNullTerminatedStringRef manually. 
You've now introduced another string-like type, which people have to figure out 
how it works. If you really feel like you must avoid the extra line of code 
(because that's the only thing that this saves, really) then you could at least 
move the class into the implementation of the methods, so that at least the 
inferface is consistent with all other llvm functions taking an llvm::Twine. 
You could define an llvm::Twine constructor and a "const char *" conversion 
operator for this class, so that you can type 
`Py_whatever(NullTerminated(twine))`. This way we could also define a "char *" 
conversion operator on the class in the PY2 case, also avoiding the need for 
the py2_const_cast thingy.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69133/new/

https://reviews.llvm.org/D69133



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

Reply via email to