1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Replace a temporary std::string with SmallString.

llvm-svn: 97259
This commit is contained in:
Benjamin Kramer 2010-02-26 20:28:29 +00:00
parent 61830209a6
commit db1d98a624

View File

@ -174,7 +174,8 @@ MemoryBuffer *MemoryBuffer::getFile(StringRef Filename, std::string *ErrStr,
#ifdef O_BINARY
OpenFlags |= O_BINARY; // Open input file in binary mode on win32.
#endif
int FD = ::open(Filename.str().c_str(), O_RDONLY|OpenFlags);
SmallString<256> PathBuf(Filename.begin(), Filename.end());
int FD = ::open(PathBuf.c_str(), O_RDONLY|OpenFlags);
if (FD == -1) {
if (ErrStr) *ErrStr = strerror(errno);
return 0;