From 956bff827ad1ff19546cedce32a842efd7f81848 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Fri, 12 Jun 2015 22:22:50 +0000 Subject: [PATCH] [Orc] Tidy up the CompileOnDemand layer based on commit review from dblaikie. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239642 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h index d4e6b19dc3d..4c515dbfa8e 100644 --- a/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h +++ b/include/llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h @@ -262,12 +262,12 @@ private: // Grab the name of the function being called here. std::string CalledFnName = Mangle(F.getName(), SrcM.getDataLayout()); - const auto &Partition = LD.getDylibResources().Partitioner(F); + auto Partition = LD.getDylibResources().Partitioner(F); auto PartitionH = emitPartition(LD, LMH, Partition); TargetAddress CalledAddr = 0; for (auto *SubF : Partition) { - std::string FName(SubF->getName()); + std::string FName = SubF->getName(); auto FnBodySym = BaseLayer.findSymbolIn(PartitionH, Mangle(FName, SrcM.getDataLayout()), false); @@ -279,7 +279,7 @@ private: assert(FnBodySym && "Couldn't find function body."); assert(FnPtrSym && "Couldn't find function body pointer."); - auto FnBodyAddr = FnBodySym.getAddress(); + TargetAddress FnBodyAddr = FnBodySym.getAddress(); void *FnPtrAddr = reinterpret_cast( static_cast(FnPtrSym.getAddress())); @@ -294,14 +294,15 @@ private: return CalledAddr; } + template BaseLayerModuleSetHandleT emitPartition(CODLogicalDylib &LD, LogicalModuleHandle LMH, - const std::set &Partition) { + const PartitionT &Partition) { auto &LMResources = LD.getLogicalModuleResources(LMH); Module &SrcM = *LMResources.SourceModule; // Create the module. - std::string NewName(SrcM.getName()); + std::string NewName = SrcM.getName(); for (auto *F : Partition) { NewName += "."; NewName += F->getName(); -- 2.34.1