LLVM API Documentation

Public Member Functions
llvm::RTDyldMemoryManager Class Reference

#include <RuntimeDyld.h>

Inheritance diagram for llvm::RTDyldMemoryManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 RTDyldMemoryManager ()
virtual ~RTDyldMemoryManager ()
virtual uint8_t * allocateCodeSection (uintptr_t Size, unsigned Alignment, unsigned SectionID)=0
virtual uint8_t * allocateDataSection (uintptr_t Size, unsigned Alignment, unsigned SectionID, bool IsReadOnly)=0
virtual void * getPointerToNamedFunction (const std::string &Name, bool AbortOnFailure=true)=0
virtual bool finalizeMemory (std::string *ErrMsg=0)=0
virtual void registerEHFrames (StringRef SectionData)

Detailed Description

Definition at line 32 of file RuntimeDyld.h.


Constructor & Destructor Documentation

llvm::RTDyldMemoryManager::RTDyldMemoryManager ( ) [inline]

Definition at line 36 of file RuntimeDyld.h.

RTDyldMemoryManager::~RTDyldMemoryManager ( ) [virtual]

Definition at line 27 of file RuntimeDyld.cpp.


Member Function Documentation

virtual uint8_t* llvm::RTDyldMemoryManager::allocateCodeSection ( uintptr_t  Size,
unsigned  Alignment,
unsigned  SectionID 
) [pure virtual]

Allocate a memory block of (at least) the given size suitable for executable code. The SectionID is a unique identifier assigned by the JIT engine, and optionally recorded by the memory manager to access a loaded section.

Implemented in llvm::SectionMemoryManager.

virtual uint8_t* llvm::RTDyldMemoryManager::allocateDataSection ( uintptr_t  Size,
unsigned  Alignment,
unsigned  SectionID,
bool  IsReadOnly 
) [pure virtual]

Allocate a memory block of (at least) the given size suitable for data. The SectionID is a unique identifier assigned by the JIT engine, and optionally recorded by the memory manager to access a loaded section.

Implemented in llvm::SectionMemoryManager.

virtual bool llvm::RTDyldMemoryManager::finalizeMemory ( std::string *  ErrMsg = 0) [pure virtual]

This method is called when object loading is complete and section page permissions can be applied. It is up to the memory manager implementation to decide whether or not to act on this method. The memory manager will typically allocate all sections as read-write and then apply specific permissions when this method is called. Code sections cannot be executed until this function has been called. In addition, any cache coherency operations needed to reliably use the memory are also performed.

Returns true if an error occurred, false otherwise.

Implemented in llvm::SectionMemoryManager.

Referenced by llvm::MCJIT::finalizeObject().

virtual void* llvm::RTDyldMemoryManager::getPointerToNamedFunction ( const std::string &  Name,
bool  AbortOnFailure = true 
) [pure virtual]

This method returns the address of the specified function. As such it is only useful for resolving library symbols, not code generated symbols.

If AbortOnFailure is false and no function with the given name is found, this function returns a null pointer. Otherwise, it prints a message to stderr and aborts.

Implemented in llvm::SectionMemoryManager.

Referenced by llvm::MCJIT::getPointerToNamedFunction(), and llvm::JIT::getPointerToNamedFunction().

void RTDyldMemoryManager::registerEHFrames ( StringRef  SectionData) [virtual]

Register the EH frames with the runtime so that c++ exceptions work. The default implementation does nothing. Look at SectionMemoryManager for one that uses __register_frame.

Reimplemented in llvm::SectionMemoryManager.

Definition at line 28 of file RuntimeDyld.cpp.

Referenced by llvm::MCJIT::finalizeObject().


The documentation for this class was generated from the following files: