diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-02-15 14:58:40 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-02-15 14:58:40 +0000 |
commit | 13138422bc354a1ec35f53a27c4efeccdffc5639 (patch) | |
tree | 8948a8a0aadc77afefcbe0f84abe732eece4aaa0 /contrib/llvm-project/llvm/tools | |
parent | c246b3930d394722a836a9e724bd5ffba7c4a9b7 (diff) | |
parent | d75c7debad4509ece98792074e64b8a650a27bdb (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/tools')
-rw-r--r-- | contrib/llvm-project/llvm/tools/lli/lli.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/contrib/llvm-project/llvm/tools/lli/lli.cpp b/contrib/llvm-project/llvm/tools/lli/lli.cpp index bfe7e8f04303..0efd0df2c12b 100644 --- a/contrib/llvm-project/llvm/tools/lli/lli.cpp +++ b/contrib/llvm-project/llvm/tools/lli/lli.cpp @@ -197,6 +197,11 @@ namespace { cl::desc("Generate software floating point library calls"), cl::init(false)); + cl::opt<bool> NoProcessSymbols( + "no-process-syms", + cl::desc("Do not resolve lli process symbols in JIT'd code"), + cl::init(false)); + enum class DumpKind { NoDump, DumpFuncsToStdOut, @@ -794,12 +799,16 @@ int runOrcLazyJIT(const char *ProgName) { }); orc::MangleAndInterner Mangle(J->getExecutionSession(), J->getDataLayout()); - J->getMainJITDylib().addGenerator( - ExitOnErr(orc::DynamicLibrarySearchGenerator::GetForCurrentProcess( - J->getDataLayout().getGlobalPrefix(), - [MainName = Mangle("main")](const orc::SymbolStringPtr &Name) { - return Name != MainName; - }))); + + // Unless they've been explicitly disabled, make process symbols available to + // JIT'd code. + if (!NoProcessSymbols) + J->getMainJITDylib().addGenerator( + ExitOnErr(orc::DynamicLibrarySearchGenerator::GetForCurrentProcess( + J->getDataLayout().getGlobalPrefix(), + [MainName = Mangle("main")](const orc::SymbolStringPtr &Name) { + return Name != MainName; + }))); orc::LocalCXXRuntimeOverrides CXXRuntimeOverrides; ExitOnErr(CXXRuntimeOverrides.enable(J->getMainJITDylib(), Mangle)); |