X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm%2FExecutionEngine%2FOrc%2FCompileOnDemandLayer.h;h=ff180c21b242188bae70da4b2caeb834851059e0;hp=714ca2374dc359a3343307dacb8edf2e9994f4e0;hb=be06dbe64749242c4b53ced14e4f0b6ed78c90d9;hpb=02e9778821fdc3f8f2f496ab6028369945a04d0e diff --git a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h index 714ca2374dc..ff180c21b24 100644 --- a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h +++ b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h @@ -85,7 +85,6 @@ private: typedef std::function SymbolResolverFtor; SymbolResolverFtor ExternalSymbolResolver; - PartitioningFtor Partitioner; }; typedef LogicalDylibfindSymbol(Name); }; - LDResources.Partitioner = - [](Function &F) { - std::set Partition; - Partition.insert(&F); - return Partition; - }; - // Process each of the modules in this module set. for (auto &M : Ms) addLogicalModule(LogicalDylibs.back(), @@ -265,14 +259,14 @@ private: // Grab the name of the function being called here. std::string CalledFnName = Mangle(F.getName(), SrcM.getDataLayout()); - auto Partition = LD.getDylibResources().Partitioner(F); - auto PartitionH = emitPartition(LD, LMH, Partition); + auto Part = Partition(F); + auto PartH = emitPartition(LD, LMH, Part); TargetAddress CalledAddr = 0; - for (auto *SubF : Partition) { + for (auto *SubF : Part) { std::string FName = SubF->getName(); auto FnBodySym = - BaseLayer.findSymbolIn(PartitionH, Mangle(FName, SrcM.getDataLayout()), + BaseLayer.findSymbolIn(PartH, Mangle(FName, SrcM.getDataLayout()), false); auto FnPtrSym = BaseLayer.findSymbolIn(*LD.moduleHandlesBegin(LMH), @@ -300,13 +294,13 @@ private: template BaseLayerModuleSetHandleT emitPartition(CODLogicalDylib &LD, LogicalModuleHandle LMH, - const PartitionT &Partition) { + const PartitionT &Part) { auto &LMResources = LD.getLogicalModuleResources(LMH); Module &SrcM = *LMResources.SourceModule; // Create the module. std::string NewName = SrcM.getName(); - for (auto *F : Partition) { + for (auto *F : Part) { NewName += "."; NewName += F->getName(); } @@ -317,11 +311,11 @@ private: GlobalDeclMaterializer GDM(*M, &LMResources.StubsToClone); // Create decls in the new module. - for (auto *F : Partition) + for (auto *F : Part) cloneFunctionDecl(*M, *F, &VMap); // Move the function bodies. - for (auto *F : Partition) + for (auto *F : Part) moveFunctionBody(*F, VMap, &GDM); // Create memory manager and symbol resolver. @@ -348,6 +342,7 @@ private: BaseLayerT &BaseLayer; CompileCallbackMgrT &CompileCallbackMgr; LogicalDylibList LogicalDylibs; + PartitioningFtor Partition; bool CloneStubsIntoPartitions; };