diff options
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/AutoConvert.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Support/MemoryBuffer.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/AutoConvert.cpp b/llvm/lib/Support/AutoConvert.cpp index 0b6928e..741bb7b 100644 --- a/llvm/lib/Support/AutoConvert.cpp +++ b/llvm/lib/Support/AutoConvert.cpp @@ -96,7 +96,7 @@ std::error_code llvm::setzOSFileTag(int FD, int CCSID, bool Text) { return std::error_code(); } -ErrorOr<__ccsid_t> llvm::getzOSFileTag(const char *FileName, const int FD) { +ErrorOr<__ccsid_t> llvm::getzOSFileTag(const Twine &FileName, const int FD) { // If we have a file descriptor, use it to find out file tagging. Otherwise we // need to use stat() with the file path. if (FD != -1) { @@ -110,12 +110,12 @@ ErrorOr<__ccsid_t> llvm::getzOSFileTag(const char *FileName, const int FD) { return Query.fccsid; } struct stat Attr; - if (stat(FileName, &Attr) == -1) + if (stat(FileName.str().c_str(), &Attr) == -1) return std::error_code(errno, std::generic_category()); return Attr.st_tag.ft_ccsid; } -ErrorOr<bool> llvm::needzOSConversion(const char *FileName, const int FD) { +ErrorOr<bool> llvm::needzOSConversion(const Twine &FileName, const int FD) { ErrorOr<__ccsid_t> Ccsid = getzOSFileTag(FileName, FD); if (std::error_code EC = Ccsid.getError()) return EC; diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index 1c4645a..23b9f8c 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -512,7 +512,7 @@ getOpenFileImpl(sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize, } #ifdef __MVS__ - ErrorOr<bool> NeedsConversion = needConversion(Filename.str().c_str(), FD); + ErrorOr<bool> NeedsConversion = needConversion(Filename, FD); if (std::error_code EC = NeedsConversion.getError()) return EC; // File size may increase due to EBCDIC -> UTF-8 conversion, therefore we |
