LLVM  6.0.0svn
Functions
MemoryBuffer.cpp File Reference
#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 <cassert>
#include <cerrno>
#include <cstring>
#include <new>
#include <sys/types.h>
#include <system_error>
#include <unistd.h>
Include dependency graph for MemoryBuffer.cpp:

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)
 
static ErrorOr< std::unique_ptr< MemoryBuffer > > getFileAux (const Twine &Filename, int64_t FileSize, uint64_t MapSize, uint64_t Offset, bool RequiresNullTerminator, bool IsVolatile)
 
static ErrorOr< std::unique_ptr< MemoryBuffer > > getMemoryBufferForStream (int FD, const Twine &BufferName)
 
static ErrorOr< std::unique_ptr< MemoryBuffer > > getOpenFileImpl (int FD, const Twine &Filename, uint64_t FileSize, uint64_t MapSize, int64_t Offset, bool RequiresNullTerminator, bool IsVolatile)
 
static bool shouldUseMmap (int FD, size_t FileSize, size_t MapSize, off_t Offset, bool RequiresNullTerminator, int PageSize, bool IsVolatile)
 

Function Documentation

◆ CopyStringRef()

static void CopyStringRef ( char Memory,
StringRef  Data 
)
static

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(), and llvm::StringRef::size().

Referenced by llvm::MemoryBuffer::getNewUninitMemBuffer().

◆ getFileAux()

static ErrorOr< std::unique_ptr< MemoryBuffer > > getFileAux ( const Twine Filename,
int64_t  FileSize,
uint64_t  MapSize,
uint64_t  Offset,
bool  RequiresNullTerminator,
bool  IsVolatile 
)
static

◆ getMemoryBufferForStream()

static ErrorOr<std::unique_ptr<MemoryBuffer> > getMemoryBufferForStream ( int  FD,
const Twine BufferName 
)
static

◆ getOpenFileImpl()

static ErrorOr< std::unique_ptr< MemoryBuffer > > getOpenFileImpl ( int  FD,
const Twine Filename,
uint64_t  FileSize,
uint64_t  MapSize,
int64_t  Offset,
bool  RequiresNullTerminator,
bool  IsVolatile 
)
static

◆ operator new()

void* operator new ( size_t  N,
const NamedBufferAlloc &  Alloc 
)

Definition at line 72 of file MemoryBuffer.cpp.

◆ shouldUseMmap()

static bool shouldUseMmap ( int  FD,
size_t  FileSize,
size_t  MapSize,
off_t  Offset,
bool  RequiresNullTerminator,
int  PageSize,
bool  IsVolatile 
)
static

Definition at line 280 of file MemoryBuffer.cpp.

References assert(), llvm::WebAssembly::End, and llvm::sys::fs::status().

Referenced by getOpenFileImpl().