MCPcopy Create free account
hub / github.com/ablab/spades / getFileAux

Function getFileAux

ext/src/llvm/MemoryBuffer.cpp:258–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256
257template <typename MB>
258static ErrorOr<std::unique_ptr<MB>>
259getFileAux(const Twine &Filename, int64_t FileSize, uint64_t MapSize,
260 uint64_t Offset, bool RequiresNullTerminator, bool IsVolatile) {
261 Expected<sys::fs::file_t> FDOrErr =
262 sys::fs::openNativeFileForRead(Filename, sys::fs::OF_None);
263 if (!FDOrErr)
264 return errorToErrorCode(FDOrErr.takeError());
265 sys::fs::file_t FD = *FDOrErr;
266 auto Ret = getOpenFileImpl<MB>(FD, Filename, FileSize, MapSize, Offset,
267 RequiresNullTerminator, IsVolatile);
268 sys::fs::closeFile(FD);
269 return Ret;
270}
271
272ErrorOr<std::unique_ptr<WritableMemoryBuffer>>
273WritableMemoryBuffer::getFile(const Twine &Filename, int64_t FileSize,

Callers

nothing calls this directly

Calls 2

errorToErrorCodeFunction · 0.85
takeErrorMethod · 0.45

Tested by

no test coverage detected