From 98440293fb903f69dbec401b8b4826b1fa206385 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Sat, 29 Sep 2018 23:49:57 +0000 Subject: [ORC] Add partitioning support to CompileOnDemandLayer2. CompileOnDemandLayer2 now supports user-supplied partition functions (the original CompileOnDemandLayer already supported these). Partition functions are called with the list of requested global values (i.e. global values that currently have queries waiting on them) and have an opportunity to select extra global values to materialize at the same time. Also adds testing infrastructure for the new feature to lli. llvm-svn: 343396 --- llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp') diff --git a/llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp b/llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp index cf091743f9d..9525b168fbd 100644 --- a/llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp +++ b/llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp @@ -29,11 +29,11 @@ ThreadSafeModule cloneToNewContext(ThreadSafeModule &TSM, SmallVector ClonedModuleBuffer; { - std::vector ClonedDefsInSrc; + std::set ClonedDefsInSrc; ValueToValueMapTy VMap; auto Tmp = CloneModule(*TSM.getModule(), VMap, [&](const GlobalValue *GV) { if (ShouldCloneDef(*GV)) { - ClonedDefsInSrc.push_back(const_cast(GV)); + ClonedDefsInSrc.insert(const_cast(GV)); return true; } return false; -- cgit v1.2.3