Skip to content

Commit 6ef47d7

Browse files
Fix
1 parent c4c646f commit 6ef47d7

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

Diff for: lib/Interpreter/CppInterOp.cpp

+14-9
Original file line numberDiff line numberDiff line change
@@ -3590,22 +3590,23 @@ namespace Cpp {
35903590
// Lazy materialization unit class helper
35913591
class AutoloadLibraryMU : public llvm::orc::MaterializationUnit {
35923592
std::string lib;
3593-
llvm::orc::SymbolNameVector syms;
3593+
std::string fLibrary;
3594+
llvm::orc::SymbolNameVector fSymbols;
35943595
public:
3595-
AutoloadLibraryMU(std::string Library, const llvm::orc::SymbolNameVector &Symbols)
3596-
: MaterializationUnit({getSymbolFlagsMap(Symbols), nullptr}), lib(std::move(Library)), syms(Symbols) {}
3596+
AutoloadLibraryMU(const std::string &Library, const llvm::orc::SymbolNameVector &Symbols)
3597+
: MaterializationUnit({getSymbolFlagsMap(Symbols), nullptr}), fLibrary(Library), fSymbols(Symbols) {}
35973598

35983599
StringRef getName() const override {
35993600
return "<Symbols from Autoloaded Library>";
36003601
}
36013602

36023603
void materialize(std::unique_ptr<llvm::orc::MaterializationResponsibility> R) override {
3603-
if (!sAutoSG || !sAutoSG->isEnabled()) {
3604-
R->failMaterialization();
3605-
return;
3606-
}
3604+
//if (!sAutoSG || !sAutoSG->isEnabled()) {
3605+
// R->failMaterialization();
3606+
// return;
3607+
//}
36073608

3608-
LLVM_DEBUG(dbgs() << "Materialize " << lib << " syms=" << syms);
3609+
LLVM_DEBUG(dbgs() << "Materialize " << lib << " syms=" << fSymbols);
36093610

36103611
auto& I = getInterp();
36113612
auto *DLM = I.getDynamicLibraryManager();
@@ -3614,7 +3615,7 @@ namespace Cpp {
36143615
llvm::orc::SymbolNameSet failedSymbols;
36153616
bool loadedLibrary = false;
36163617

3617-
for (const auto &symbol : syms) {
3618+
for (const auto &symbol : fSymbols) {
36183619
std::string symbolStr = (*symbol).str();
36193620
std::string nameForDlsym = DemangleNameForDlsym(symbolStr);
36203621

@@ -3662,8 +3663,12 @@ namespace Cpp {
36623663
if (!loadedSymbols.empty()) {
36633664
llvm::cantFail(R->notifyResolved(loadedSymbols));
36643665

3666+
#if CLANG_VERSION_MAJOR < 18
36653667
llvm::orc::SymbolDependenceGroup DepGroup;
36663668
llvm::cantFail(R->notifyEmitted({DepGroup}));
3669+
#else
3670+
llvm::cantFail(R->notifyEmitted());
3671+
#endif
36673672
}
36683673
}
36693674

Diff for: unittests/CppInterOp/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ target_link_libraries(CppInterOpTests
2020
)
2121

2222
set_output_directory(CppInterOpTests
23-
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/CppInterOpTests/unittests/bin/$<CONFIG>/
24-
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/CppInterOpTests/unittests/bin/$<CONFIG>/
23+
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin/$<CONFIG>/
24+
LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin/$<CONFIG>/
2525
)
2626

2727
if(NOT WIN32)

0 commit comments

Comments
 (0)