File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -412,18 +412,17 @@ class Interpreter {
412412 }
413413
414414 CompilationResult loadLibrary (const std::string& filename, bool lookup) {
415- # ifdef __EMSCRIPTEN__
416- if (lookup ) {
417- llvm::errs () << " [cppinterop] Warning: ' lookup' has no effect on WASM. \n " ;
418- }
419- // In WASM: directly use Interpreter's LoadDynamicLibrary
420- if ( auto Err = inner-> LoadDynamicLibrary (filename. c_str ())) {
421- llvm::logAllUnhandledErrors ( std::move (Err), llvm::errs (),
422- " loadLibrary: " );
423- return kFailure ;
415+ llvm::Triple triple ( getCompilerInstance ()-> getTargetOpts (). Triple );
416+ if (triple. isWasm () ) {
417+ // On WASM, dlopen-style canonical lookup has no effect.
418+ if ( auto Err = inner-> LoadDynamicLibrary (filename. c_str ())) {
419+ llvm::logAllUnhandledErrors ( std::move (Err), llvm::errs (),
420+ " loadLibrary: " );
421+ return kFailure ;
422+ }
423+ return kSuccess ;
424424 }
425- return kSuccess ;
426- #endif
425+
427426 DynamicLibraryManager* DLM = getDynamicLibraryManager ();
428427 std::string canonicalLib;
429428 if (lookup)
You can’t perform that action at this time.
0 commit comments