diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-02-26 20:28:29 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-02-26 20:28:29 +0000 |
commit | 6e08f7614ae45c39c66fbf3a8829378e151a446b (patch) | |
tree | 3c1030b81ecc75602d63d749dd1c837c3623589f | |
parent | a997e9f9b31d2cfd876d7a64d8e4b6cae030c966 (diff) | |
download | external_llvm-6e08f7614ae45c39c66fbf3a8829378e151a446b.zip external_llvm-6e08f7614ae45c39c66fbf3a8829378e151a446b.tar.gz external_llvm-6e08f7614ae45c39c66fbf3a8829378e151a446b.tar.bz2 |
Replace a temporary std::string with SmallString.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97259 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Support/MemoryBuffer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp index 9253b01..eb046d0 100644 --- a/lib/Support/MemoryBuffer.cpp +++ b/lib/Support/MemoryBuffer.cpp @@ -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; |