LLVM  3.7.0
Namespaces | Macros | Functions | Variables
DynamicLibrary.cpp File Reference
#include "llvm/Support/DynamicLibrary.h"
#include "llvm-c/Support.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Config/config.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include <cstdio>
#include <cstring>
#include <dlfcn.h>
Include dependency graph for DynamicLibrary.cpp:

Go to the source code of this file.

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define EXPLICIT_SYMBOL(SYM)   if (!strcmp(symbolName, #SYM)) return &SYM
 

Functions

void * llvm::SearchForAddressOfSpecialSymbol (const char *symbolName)
 
LLVMBool LLVMLoadLibraryPermanently (const char *Filename)
 This function permanently loads the dynamic library at the given path. More...
 
void * LLVMSearchForAddressOfSymbol (const char *symbolName)
 This function will search through all previously loaded dynamic libraries for the symbol symbolName. More...
 
void LLVMAddSymbol (const char *symbolName, void *symbolValue)
 This functions permanently adds the symbol symbolName with the value symbolValue. More...
 

Variables

static llvm::ManagedStatic
< llvm::StringMap< void * > > 
ExplicitSymbols
 
static llvm::ManagedStatic
< llvm::sys::SmartMutex< true > > 
SymbolsMutex
 
static DenseSet< void * > * OpenedHandles = nullptr
 

Macro Definition Documentation

#define EXPLICIT_SYMBOL (   SYM)    if (!strcmp(symbolName, #SYM)) return &SYM

Function Documentation

void LLVMAddSymbol ( const char *  symbolName,
void *  symbolValue 
)

This functions permanently adds the symbol symbolName with the value symbolValue.

These symbols are searched before any libraries.

See Also
sys::DynamicLibrary::AddSymbol()

Definition at line 186 of file DynamicLibrary.cpp.

References llvm::sys::DynamicLibrary::AddSymbol().

LLVMBool LLVMLoadLibraryPermanently ( const char *  Filename)

This function permanently loads the dynamic library at the given path.

It is safe to call this function multiple times for the same library.

See Also
sys::DynamicLibrary::LoadLibraryPermanently()

Definition at line 178 of file DynamicLibrary.cpp.

References llvm::sys::DynamicLibrary::LoadLibraryPermanently().

void* LLVMSearchForAddressOfSymbol ( const char *  symbolName)

This function will search through all previously loaded dynamic libraries for the symbol symbolName.

If it is found, the address of that symbol is returned. If not, null is returned.

See Also
sys::DynamicLibrary::SearchForAddressOfSymbol()

Definition at line 182 of file DynamicLibrary.cpp.

References llvm::sys::DynamicLibrary::SearchForAddressOfSymbol().

Variable Documentation

llvm::ManagedStatic<llvm::StringMap<void *> > ExplicitSymbols
static

Definition at line 27 of file DynamicLibrary.cpp.

DenseSet<void *>* OpenedHandles = nullptr
static

Definition at line 28 of file DynamicLibrary.cpp.