[examples] Fix Kaleidoscope examples after OrcJIT break-up / remote TPC commit.
authorLang Hames <lhames@gmail.com>
Fri, 13 Nov 2020 08:02:52 +0000 (19:02 +1100)
committerLang Hames <lhames@gmail.com>
Fri, 13 Nov 2020 08:13:00 +0000 (19:13 +1100)
Fix the Kaleidoscope examples after 1d0676b54c4 by explicitly creating the
SymbolStringPool.

llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h
llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
llvm/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h
llvm/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h

index 9b35456..eb2d21c 100644 (file)
@@ -65,11 +65,12 @@ public:
   }
 
   static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
-    auto TPC = SelfTargetProcessControl::Create();
+    auto SSP = std::make_shared<SymbolStringPool>();
+    auto TPC = SelfTargetProcessControl::Create(SSP);
     if (!TPC)
       return TPC.takeError();
 
-    auto ES = std::make_unique<ExecutionSession>();
+    auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
 
     JITTargetMachineBuilder JTMB((*TPC)->getTargetTriple());
 
index cc3700b..517b2d3 100644 (file)
@@ -72,11 +72,12 @@ public:
   }
 
   static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
-    auto TPC = SelfTargetProcessControl::Create();
+    auto SSP = std::make_shared<SymbolStringPool>();
+    auto TPC = SelfTargetProcessControl::Create(SSP);
     if (!TPC)
       return TPC.takeError();
 
-    auto ES = std::make_unique<ExecutionSession>();
+    auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
 
     JITTargetMachineBuilder JTMB((*TPC)->getTargetTriple());
 
index 810a4cd..675c938 100644 (file)
@@ -87,11 +87,12 @@ public:
   }
 
   static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
-    auto TPC = SelfTargetProcessControl::Create();
+    auto SSP = std::make_shared<SymbolStringPool>();
+    auto TPC = SelfTargetProcessControl::Create(SSP);
     if (!TPC)
       return TPC.takeError();
 
-    auto ES = std::make_unique<ExecutionSession>();
+    auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
 
     auto TPCIU = TPCIndirectionUtils::Create(**TPC);
     if (!TPCIU)
index ba63e7c..e22dc55 100644 (file)
@@ -172,11 +172,12 @@ public:
   }
 
   static Expected<std::unique_ptr<KaleidoscopeJIT>> Create() {
-    auto TPC = SelfTargetProcessControl::Create();
+    auto SSP = std::make_shared<SymbolStringPool>();
+    auto TPC = SelfTargetProcessControl::Create(SSP);
     if (!TPC)
       return TPC.takeError();
 
-    auto ES = std::make_unique<ExecutionSession>();
+    auto ES = std::make_unique<ExecutionSession>(std::move(SSP));
 
     auto TPCIU = TPCIndirectionUtils::Create(**TPC);
     if (!TPCIU)