LLVM  mainline
Public Member Functions | Static Public Member Functions
llvm::RTDyldMemoryManager Class Reference

#include <RTDyldMemoryManager.h>

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

List of all members.

Public Member Functions

 RTDyldMemoryManager ()
 ~RTDyldMemoryManager () override
void registerEHFrames (uint8_t *Addr, uint64_t LoadAddr, size_t Size) override
 Register the EH frames with the runtime so that c++ exceptions work.
void deregisterEHFrames (uint8_t *Addr, uint64_t LoadAddr, size_t Size) override
virtual uint64_t getSymbolAddress (const std::string &Name)
 Legacy symbol lookup - DEPRECATED! Please override findSymbol instead.
RuntimeDyld::SymbolInfo findSymbol (const std::string &Name) override
 This method returns a RuntimeDyld::SymbolInfo for the specified function or variable.
virtual uint64_t getSymbolAddressInLogicalDylib (const std::string &Name)
 Legacy symbol lookup -- DEPRECATED! Please override findSymbolInLogicalDylib instead.
RuntimeDyld::SymbolInfo findSymbolInLogicalDylib (const std::string &Name) override
 Default to treating all modules as separate.
virtual void * getPointerToNamedFunction (const std::string &Name, bool AbortOnFailure=true)
 This method returns the address of the specified function.

Static Public Member Functions

static uint64_t getSymbolAddressInProcess (const std::string &Name)
 This method returns the address of the specified function or variable in the current process.

Detailed Description

Definition at line 53 of file RTDyldMemoryManager.h.


Constructor & Destructor Documentation

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

Definition at line 58 of file RTDyldMemoryManager.h.

Definition at line 33 of file RTDyldMemoryManager.cpp.


Member Function Documentation

void llvm::RTDyldMemoryManager::deregisterEHFrames ( uint8_t *  Addr,
uint64_t  LoadAddr,
size_t  Size 
) [override, virtual]

Implements llvm::RuntimeDyld::MemoryManager.

Definition at line 132 of file RTDyldMemoryManager.cpp.

References llvm::__deregister_frame().

RuntimeDyld::SymbolInfo llvm::RTDyldMemoryManager::findSymbol ( const std::string &  Name) [inline, override, virtual]

This method returns a RuntimeDyld::SymbolInfo for the specified function or variable.

It is used to resolve symbols during module linking.

By default this falls back on the legacy lookup method: 'getSymbolAddress'. The address returned by getSymbolAddress is treated as a strong, exported symbol, consistent with historical treatment by RuntimeDyld.

Clients writing custom RTDyldMemoryManagers are encouraged to override this method and return a SymbolInfo with the flags set correctly. This is necessary for RuntimeDyld to correctly handle weak and non-exported symbols.

Implements llvm::RuntimeDyld::SymbolResolver.

Definition at line 87 of file RTDyldMemoryManager.h.

References llvm::Exported, and getSymbolAddress().

RuntimeDyld::SymbolInfo llvm::RTDyldMemoryManager::findSymbolInLogicalDylib ( const std::string &  Name) [inline, override, virtual]

Default to treating all modules as separate.

By default this falls back on the legacy lookup method: 'getSymbolAddressInLogicalDylib'. The address returned by getSymbolAddressInLogicalDylib is treated as a strong, exported symbol, consistent with historical treatment by RuntimeDyld.

Clients writing custom RTDyldMemoryManagers are encouraged to override this method and return a SymbolInfo with the flags set correctly. This is necessary for RuntimeDyld to correctly handle weak and non-exported symbols.

Implements llvm::RuntimeDyld::SymbolResolver.

Definition at line 111 of file RTDyldMemoryManager.h.

References llvm::Exported, and getSymbolAddressInLogicalDylib().

void * llvm::RTDyldMemoryManager::getPointerToNamedFunction ( const std::string &  Name,
bool  AbortOnFailure = true 
) [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.

This function is deprecated for memory managers to be used with MCJIT or RuntimeDyld. Use getSymbolAddress instead.

Definition at line 284 of file RTDyldMemoryManager.cpp.

References getSymbolAddress(), and llvm::report_fatal_error().

virtual uint64_t llvm::RTDyldMemoryManager::getSymbolAddress ( const std::string &  Name) [inline, virtual]

Legacy symbol lookup - DEPRECATED! Please override findSymbol instead.

This method returns the address of the specified function or variable. It is used to resolve symbols during module linking.

Definition at line 72 of file RTDyldMemoryManager.h.

References getSymbolAddressInProcess().

Referenced by findSymbol(), and getPointerToNamedFunction().

virtual uint64_t llvm::RTDyldMemoryManager::getSymbolAddressInLogicalDylib ( const std::string &  Name) [inline, virtual]

Legacy symbol lookup -- DEPRECATED! Please override findSymbolInLogicalDylib instead.

Default to treating all modules as separate.

Definition at line 96 of file RTDyldMemoryManager.h.

Referenced by findSymbolInLogicalDylib().

uint64_t llvm::RTDyldMemoryManager::getSymbolAddressInProcess ( const std::string &  Name) [static]

This method returns the address of the specified function or variable in the current process.

Definition at line 220 of file RTDyldMemoryManager.cpp.

References llvm::jit_noop(), and llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().

Referenced by getSymbolAddress().

void llvm::RTDyldMemoryManager::registerEHFrames ( uint8_t *  Addr,
uint64_t  LoadAddr,
size_t  Size 
) [override, virtual]

Register the EH frames with the runtime so that c++ exceptions work.

Addr parameter provides the local address of the EH frame section data, while LoadAddr provides the address of the data in the target address space. If the section has not been remapped (which will usually be the case for local execution) these two values will be the same.

Implements llvm::RuntimeDyld::MemoryManager.

Definition at line 121 of file RTDyldMemoryManager.cpp.

References llvm::__register_frame().


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