cl::ParseCommandLineOptions(): Use StringRef to receive sys::path::filename() instead of std::string.

llvm-svn: 206990
This commit is contained in:
NAKAMURA Takumi 2014-04-23 14:51:23 +00:00
parent fe16a620a7
commit c2c6649d61
1 changed files with 1 additions and 1 deletions

View File

@ -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';