Add a new flag that disables symbol lookup with dlsym when set. This allows

a JIT client to completely control symbol lookup with the LazyFunctionCreator
interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52335 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2008-06-16 17:44:14 +00:00
parent 16228c08b4
commit e846db6675
2 changed files with 48 additions and 36 deletions

View File

@@ -65,6 +65,7 @@ class ExecutionEngine {
const TargetData *TD;
ExecutionEngineState state;
bool LazyCompilationDisabled;
bool SymbolSearchingDisabled;
protected:
/// Modules - This is a list of ModuleProvider's that we are JIT'ing from. We
@@ -243,13 +244,22 @@ public:
}
/// DisableLazyCompilation - If called, the JIT will abort if lazy compilation
// is ever attempted.
void DisableLazyCompilation() {
LazyCompilationDisabled = true;
/// is ever attempted.
void DisableLazyCompilation(bool Disabled = true) {
LazyCompilationDisabled = Disabled;
}
bool isLazyCompilationDisabled() const {
return LazyCompilationDisabled;
}
/// DisableSymbolSearching - If called, the JIT will not try to lookup unknown
/// symbols with dlsym. A client can still use InstallLazyFunctionCreator to
/// resolve symbols in a custom way.
void DisableSymbolSearching(bool Disabled = true) {
SymbolSearchingDisabled = Disabled;
}
bool isSymbolSearchingDisabled() const {
return SymbolSearchingDisabled;
}
/// InstallLazyFunctionCreator - If an unknown function is needed, the