forked from OSchip/llvm-project
cl::ParseCommandLineOptions(): Use StringRef to receive sys::path::filename() instead of std::string.
llvm-svn: 206990
This commit is contained in:
parent
fe16a620a7
commit
c2c6649d61
|
@ -748,7 +748,7 @@ void cl::ParseCommandLineOptions(int argc, const char * const *argv,
|
|||
argc = static_cast<int>(newArgv.size());
|
||||
|
||||
// Copy the program name into ProgName, making sure not to overflow it.
|
||||
std::string ProgName = sys::path::filename(argv[0]);
|
||||
StringRef ProgName = sys::path::filename(argv[0]);
|
||||
size_t Len = std::min(ProgName.size(), size_t(79));
|
||||
memcpy(ProgramName, ProgName.data(), Len);
|
||||
ProgramName[Len] = '\0';
|
||||
|
|
Loading…
Reference in New Issue