[llvm] 1bf805d - [examples] Fix Kaleidoscope examples after OrcJIT break-up / remote TPC commit.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 00:13:18 PST 2020


Author: Lang Hames
Date: 2020-11-13T19:13:00+11:00
New Revision: 1bf805dd2cb22726bcfaf5137ee8fbc1c3a3b158

URL: https://github.com/llvm/llvm-project/commit/1bf805dd2cb22726bcfaf5137ee8fbc1c3a3b158
DIFF: https://github.com/llvm/llvm-project/commit/1bf805dd2cb22726bcfaf5137ee8fbc1c3a3b158.diff

LOG: [examples] Fix Kaleidoscope examples after OrcJIT break-up / remote TPC commit.

Fix the Kaleidoscope examples after 1d0676b54c4 by explicitly creating the
SymbolStringPool.

Added: 
    

Modified: 
    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

Removed: 
    


################################################################################
diff  --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h
index 9b35456a7041..eb2d21c50b9a 100644
--- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h
+++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h
@@ -65,11 +65,12 @@ class KaleidoscopeJIT {
   }
 
   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());
 

diff  --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
index cc3700b71faa..517b2d3f8d96 100644
--- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
+++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
@@ -72,11 +72,12 @@ class KaleidoscopeJIT {
   }
 
   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());
 

diff  --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h
index 810a4cd48e30..675c938392ed 100644
--- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h
+++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter3/KaleidoscopeJIT.h
@@ -87,11 +87,12 @@ class KaleidoscopeJIT {
   }
 
   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)

diff  --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h
index ba63e7cf9ca5..e22dc5512727 100644
--- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h
+++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter4/KaleidoscopeJIT.h
@@ -172,11 +172,12 @@ class KaleidoscopeJIT {
   }
 
   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)


        


More information about the llvm-commits mailing list