llvm.org GIT mirror llvm / d457461
Orc: PR33769: Don't rely on comparisons with default constructed iterators git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310729 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 2 years ago
1 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
1414 #ifndef LLVM_TOOLS_LLI_ORCLAZYJIT_H
1515 #define LLVM_TOOLS_LLI_ORCLAZYJIT_H
1616
17 #include "llvm/ADT/Optional.h"
1718 #include "llvm/ADT/STLExtras.h"
1819 #include "llvm/ADT/Twine.h"
1920 #include "llvm/ExecutionEngine/JITSymbol.h"
2021 #include "llvm/ExecutionEngine/Orc/CompileOnDemandLayer.h"
2122 #include "llvm/ExecutionEngine/Orc/CompileUtils.h"
2223 #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
23 #include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"
2424 #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
2525 #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h"
26 #include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"
2627 #include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
2728 #include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
2829 #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
111112 // 1) Search the JIT symbols.
112113 // 2) Check for C++ runtime overrides.
113114 // 3) Search the host process (LLI)'s symbol table.
114 if (ModulesHandle == CODLayerT::ModuleHandleT()) {
115 if (!ModulesHandle) {
115116 auto Resolver =
116117 orc::createLambdaResolver(
117118 [this](const std::string &Name) -> JITSymbol {
134135 else
135136 return ModulesHandleOrErr.takeError();
136137
137 } else
138 if (auto Err = CODLayer.addExtraModule(ModulesHandle, std::move(M)))
139 return Err;
138 } else if (auto Err = CODLayer.addExtraModule(*ModulesHandle, std::move(M)))
139 return Err;
140140
141141 // Run the static constructors, and save the static destructor runner for
142142 // execution when the JIT is torn down.
143143 orc::CtorDtorRunner CtorRunner(std::move(CtorNames),
144 ModulesHandle);
144 *ModulesHandle);
145145 if (auto Err = CtorRunner.runViaLayer(CODLayer))
146146 return Err;
147147
148148 IRStaticDestructorRunners.emplace_back(std::move(DtorNames),
149 ModulesHandle);
149 *ModulesHandle);
150150
151151 return Error::success();
152152 }
189189
190190 orc::LocalCXXRuntimeOverrides CXXRuntimeOverrides;
191191 std::vector> IRStaticDestructorRunners;
192 CODLayerT::ModuleHandleT ModulesHandle;
192 llvm::Optional ModulesHandle;
193193 };
194194
195195 int runOrcLazyJIT(std::vector> Ms,