add current process symbol to dylib LLVM >= 18 does this automatically
| 185 | // add current process symbol to dylib |
| 186 | // LLVM >= 18 does this automatically |
| 187 | void AddProcessSymbol(llvm::orc::LLJIT& lljit) { |
| 188 | lljit.getMainJITDylib().addGenerator( |
| 189 | llvm::cantFail(llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess( |
| 190 | lljit.getDataLayout().getGlobalPrefix()))); |
| 191 | // the `atexit` symbol cannot be found for ASAN |
| 192 | #if defined(ADDRESS_SANITIZER) && LLVM_VERSION_MAJOR < 18 |
| 193 | if (!lljit.lookup("atexit")) { |
| 194 | AddAbsoluteSymbol(lljit, "atexit", reinterpret_cast<void*>(atexit)); |
| 195 | } |
| 196 | #endif |
| 197 | } |
| 198 | |
| 199 | #ifdef JIT_LINK_SUPPORTED |
| 200 | Result<std::unique_ptr<llvm::jitlink::InProcessMemoryManager>> CreateMemmoryManager() { |
no test coverage detected