Its mainly an efficiency thing. If you have a std::string you might need to 
allocate data on the heap to store the string just to make the call. Since this 
argument is a path, it is more likely to have to allocate on the heap. Most 
std::string implementations store the first 20 some bytes in the std::string 
itself, but if it goes over, it will need to malloc a buffer for the string and 
make a copy. Most path arguments in the standard libraries and in functions 
already take "const char *" for paths, so it is just keeping the argument in 
the currency that most people want is good. I also don't like llvm::StringRef 
for the path because if you want to guarantee NULL terminate you will need to 
call my_str.str().c_str() which makes a temp std::string using the length, so I 
do think "const char *" is the best for the API.


http://reviews.llvm.org/D8547

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to