summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-02-09 02:30:40 +0000
committerLang Hames <lhames@gmail.com>2018-02-09 02:30:40 +0000
commit0976cee8e9d6dbf890cb25299baac973307e2d9a (patch)
treec5fccb3bd0a483d8a5cafb402e43729da0c6b4ad /llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2
parent6562b3d954b57b04daf0b1bf72c402d9aabd633e (diff)
downloadbcm5719-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/Chapter2')
-rw-r--r--llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
index 4b7549391b9..c04244a4ad7 100644
--- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
+++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
@@ -56,7 +56,6 @@ private:
IRTransformLayer<decltype(CompileLayer), OptimizeFunction> OptimizeLayer;
public:
- using ModuleHandle = decltype(OptimizeLayer)::ModuleHandleT;
KaleidoscopeJIT()
: ES(SSP),
@@ -86,10 +85,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(
- OptimizeLayer.addModule(ES.allocateVModule(), std::move(M)));
+ auto K = ES.allocateVModule();
+ cantFail(OptimizeLayer.addModule(K, std::move(M)));
+ return K;
}
JITSymbol findSymbol(const std::string Name) {
@@ -99,8 +99,8 @@ public:
return OptimizeLayer.findSymbol(MangledNameStream.str(), true);
}
- void removeModule(ModuleHandle H) {
- cantFail(OptimizeLayer.removeModule(H));
+ void removeModule(VModuleKey K) {
+ cantFail(OptimizeLayer.removeModule(K));
}
private:
OpenPOWER on IntegriCloud