diff options
| author | Lang Hames <lhames@gmail.com> | 2018-02-09 02:30:40 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2018-02-09 02:30:40 +0000 |
| commit | 0976cee8e9d6dbf890cb25299baac973307e2d9a (patch) | |
| tree | c5fccb3bd0a483d8a5cafb402e43729da0c6b4ad /llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1 | |
| parent | 6562b3d954b57b04daf0b1bf72c402d9aabd633e (diff) | |
| download | bcm5719-llvm-0976cee8e9d6dbf890cb25299baac973307e2d9a.tar.gz bcm5719-llvm-0976cee8e9d6dbf890cb25299baac973307e2d9a.zip | |
[ORC] Remove Layer handles from the layer concept.
Handles were returned by addModule and used as keys for removeModule,
findSymbolIn, and emitAndFinalize. Their job is now subsumed by VModuleKeys,
which simplify resource management by providing a consistent handle across all
layers.
llvm-svn: 324700
Diffstat (limited to 'llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1')
| -rw-r--r-- | llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h index 91709433d93..a5553f488bb 100644 --- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h +++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h @@ -47,7 +47,6 @@ private: IRCompileLayer<decltype(ObjectLayer), SimpleCompiler> CompileLayer; public: - using ModuleHandle = decltype(CompileLayer)::ModuleHandleT; KaleidoscopeJIT() : ES(SSP), @@ -74,9 +73,11 @@ public: TargetMachine &getTargetMachine() { return *TM; } - ModuleHandle addModule(std::unique_ptr<Module> M) { + VModuleKey addModule(std::unique_ptr<Module> M) { // Add the module to the JIT with a new VModuleKey. - return cantFail(CompileLayer.addModule(ES.allocateVModule(), std::move(M))); + auto K = ES.allocateVModule(); + cantFail(CompileLayer.addModule(K, std::move(M))); + return K; } JITSymbol findSymbol(const std::string Name) { @@ -90,8 +91,8 @@ public: return cantFail(findSymbol(Name).getAddress()); } - void removeModule(ModuleHandle H) { - cantFail(CompileLayer.removeModule(H)); + void removeModule(VModuleKey K) { + cantFail(CompileLayer.removeModule(K)); } }; |

