|
LLVM
10.0.0
|
#include "llvm/Support/MemoryBuffer.h"#include "llvm/ADT/SmallString.h"#include "llvm/Config/config.h"#include "llvm/Support/Errc.h"#include "llvm/Support/Errno.h"#include "llvm/Support/FileSystem.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/Path.h"#include "llvm/Support/Process.h"#include "llvm/Support/Program.h"#include "llvm/Support/SmallVectorMemoryBuffer.h"#include <cassert>#include <cerrno>#include <cstring>#include <new>#include <sys/types.h>#include <system_error>#include <unistd.h>Go to the source code of this file.
Functions | |
| static void | CopyStringRef (char *Memory, StringRef Data) |
| CopyStringRef - Copies contents of a StringRef into a block of memory and null-terminates it. More... | |
| void * | operator new (size_t N, const NamedBufferAlloc &Alloc) |
| template<typename MB > | |
| static ErrorOr< std::unique_ptr< MB > > | getFileAux (const Twine &Filename, int64_t FileSize, uint64_t MapSize, uint64_t Offset, bool RequiresNullTerminator, bool IsVolatile) |
| static ErrorOr< std::unique_ptr< WritableMemoryBuffer > > | getMemBufferCopyImpl (StringRef InputData, const Twine &BufferName) |
| static ErrorOr< std::unique_ptr< WritableMemoryBuffer > > | getMemoryBufferForStream (sys::fs::file_t FD, const Twine &BufferName) |
| template<typename MB > | |
| static ErrorOr< std::unique_ptr< MB > > | getOpenFileImpl (sys::fs::file_t FD, const Twine &Filename, uint64_t FileSize, uint64_t MapSize, int64_t Offset, bool RequiresNullTerminator, bool IsVolatile) |
| static bool | shouldUseMmap (sys::fs::file_t FD, size_t FileSize, size_t MapSize, off_t Offset, bool RequiresNullTerminator, int PageSize, bool IsVolatile) |
| static ErrorOr< std::unique_ptr< WriteThroughMemoryBuffer > > | getReadWriteFile (const Twine &Filename, uint64_t FileSize, uint64_t MapSize, uint64_t Offset) |
CopyStringRef - Copies contents of a StringRef into a block of memory and null-terminates it.
Definition at line 59 of file MemoryBuffer.cpp.
References llvm::StringRef::data(), llvm::StringRef::empty(), Name, and llvm::StringRef::size().
Referenced by llvm::WritableMemoryBuffer::getNewUninitMemBuffer().
|
static |
Definition at line 245 of file MemoryBuffer.cpp.
References llvm::sys::fs::closeFile(), llvm::errorToErrorCode(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile, llvm::sys::fs::OF_None, llvm::sys::fs::openNativeFileForRead(), llvm::MipsISD::Ret, and llvm::Expected< T >::takeError().
|
static |
Definition at line 126 of file MemoryBuffer.cpp.
References llvm::StringRef::data(), llvm::WritableMemoryBuffer::getNewUninitMemBuffer(), llvm::make_error_code(), llvm::not_enough_memory, and llvm::StringRef::size().
Referenced by llvm::MemoryBuffer::getMemBufferCopy(), and getMemoryBufferForStream().
|
static |
Definition at line 211 of file MemoryBuffer.cpp.
References llvm::SmallVectorTemplateCommon< T >::end(), llvm::errorToErrorCode(), getMemBufferCopyImpl(), llvm::makeMutableArrayRef(), llvm::sys::fs::readNativeFile(), llvm::SmallVectorImpl< char >::reserve(), llvm::SmallVectorBase::set_size(), llvm::SmallVectorBase::size(), and llvm::Expected< T >::takeError().
Referenced by llvm::MemoryBuffer::getFileAsStream(), getOpenFileImpl(), and llvm::MemoryBuffer::getSTDIN().
|
static |
Definition at line 418 of file MemoryBuffer.cpp.
References llvm::sys::fs::block_file, llvm::MutableArrayRef< T >::data(), llvm::MutableArrayRef< T >::drop_front(), llvm::ArrayRef< T >::empty(), llvm::errorToErrorCode(), getMemoryBufferForStream(), llvm::WritableMemoryBuffer::getNewUninitMemBuffer(), llvm::sys::Process::getPageSizeEstimate(), llvm::sys::fs::basic_file_status::getSize(), llvm::make_error_code(), llvm::not_enough_memory, PageSize, llvm::sys::fs::readNativeFileSlice(), llvm::sys::fs::regular_file, shouldUseMmap(), llvm::ArrayRef< T >::size(), llvm::sys::fs::status(), llvm::Expected< T >::takeError(), and llvm::sys::fs::basic_file_status::type().
Referenced by llvm::MemoryBuffer::getFile().
|
static |
Definition at line 364 of file MemoryBuffer.cpp.
References llvm::sys::fs::block_file, llvm::sys::fs::CD_OpenExisting, llvm::errorToErrorCode(), llvm::sys::fs::basic_file_status::getSize(), llvm::invalid_argument, llvm::make_error_code(), llvm::sys::fs::OF_None, llvm::sys::fs::openNativeFileForReadWrite(), llvm::sys::fs::regular_file, llvm::sys::fs::status(), llvm::Expected< T >::takeError(), and llvm::sys::fs::basic_file_status::type().
Referenced by llvm::WriteThroughMemoryBuffer::getFile(), and llvm::WriteThroughMemoryBuffer::getFileSlice().
| void* operator new | ( | size_t | N, |
| const NamedBufferAlloc & | Alloc | ||
| ) |
Definition at line 72 of file MemoryBuffer.cpp.
|
static |
Definition at line 308 of file MemoryBuffer.cpp.
References llvm::sys::fs::basic_file_status::getSize(), and llvm::sys::fs::status().
Referenced by getOpenFileImpl().
1.8.13