diff options
Diffstat (limited to 'llvm/lib/XRay')
| -rw-r--r-- | llvm/lib/XRay/InstrumentationMap.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/XRay/Profile.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/XRay/Trace.cpp | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/XRay/InstrumentationMap.cpp b/llvm/lib/XRay/InstrumentationMap.cpp index 2eeb4559021..5b90c5a7ebd 100644 --- a/llvm/lib/XRay/InstrumentationMap.cpp +++ b/llvm/lib/XRay/InstrumentationMap.cpp @@ -178,7 +178,8 @@ loadYAML(int Fd, size_t FileSize, StringRef Filename, InstrumentationMap::FunctionAddressReverseMap &FunctionIds) { std::error_code EC; sys::fs::mapped_file_region MappedFile( - Fd, sys::fs::mapped_file_region::mapmode::readonly, FileSize, 0, EC); + sys::fs::convertFDToNativeFile(Fd), + sys::fs::mapped_file_region::mapmode::readonly, FileSize, 0, EC); if (EC) return make_error<StringError>( Twine("Failed memory-mapping file '") + Filename + "'.", EC); diff --git a/llvm/lib/XRay/Profile.cpp b/llvm/lib/XRay/Profile.cpp index e92eb7e3a7e..9ba8eb1088d 100644 --- a/llvm/lib/XRay/Profile.cpp +++ b/llvm/lib/XRay/Profile.cpp @@ -272,7 +272,8 @@ Expected<Profile> loadProfile(StringRef Filename) { std::error_code EC; sys::fs::mapped_file_region MappedFile( - Fd, sys::fs::mapped_file_region::mapmode::readonly, FileSize, 0, EC); + sys::fs::convertFDToNativeFile(Fd), + sys::fs::mapped_file_region::mapmode::readonly, FileSize, 0, EC); if (EC) return make_error<StringError>( Twine("Cannot mmap profile '") + Filename + "'", EC); diff --git a/llvm/lib/XRay/Trace.cpp b/llvm/lib/XRay/Trace.cpp index f0a70038d3b..0945c8e847e 100644 --- a/llvm/lib/XRay/Trace.cpp +++ b/llvm/lib/XRay/Trace.cpp @@ -391,7 +391,8 @@ Expected<Trace> llvm::xray::loadTraceFile(StringRef Filename, bool Sort) { // Map the opened file into memory and use a StringRef to access it later. std::error_code EC; sys::fs::mapped_file_region MappedFile( - Fd, sys::fs::mapped_file_region::mapmode::readonly, FileSize, 0, EC); + sys::fs::convertFDToNativeFile(Fd), + sys::fs::mapped_file_region::mapmode::readonly, FileSize, 0, EC); if (EC) { return make_error<StringError>( Twine("Cannot read log from '") + Filename + "'", EC); |

