summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/ExecutionEngine/Orc
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-04-02 20:57:56 +0000
committerLang Hames <lhames@gmail.com>2018-04-02 20:57:56 +0000
commit3fdfc04e5339c1d0ad838c1e5531b3a2e4377ec3 (patch)
treeb9a2a81ff5a623dc196685546a58e9f79790a22e /llvm/include/llvm/ExecutionEngine/Orc
parent321c2487d7b1806cb3cc1a2391b130935bc06b64 (diff)
downloadbcm5719-llvm-3fdfc04e5339c1d0ad838c1e5531b3a2e4377ec3.tar.gz
bcm5719-llvm-3fdfc04e5339c1d0ad838c1e5531b3a2e4377ec3.zip
[ORC] Create a new SymbolStringPool by default in ExecutionSession constructor.
This makes the common case of constructing an ExecutionSession tidier. llvm-svn: 329013
Diffstat (limited to 'llvm/include/llvm/ExecutionEngine/Orc')
-rw-r--r--llvm/include/llvm/ExecutionEngine/Orc/Core.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/Core.h b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
index 26fec8b359f..4f530d414a8 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/Core.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/Core.h
@@ -327,10 +327,11 @@ public:
/// @brief Construct an ExecutionEngine.
///
/// SymbolStringPools may be shared between ExecutionSessions.
- ExecutionSession(SymbolStringPool &SSP);
+ ExecutionSession(std::shared_ptr<SymbolStringPool> SSP = nullptr)
+ : SSP(std::move(SSP)) {}
/// @brief Returns the SymbolStringPool for this ExecutionSession.
- SymbolStringPool &getSymbolStringPool() const { return SSP; }
+ SymbolStringPool &getSymbolStringPool() const { return *SSP; }
/// @brief Set the error reporter function.
void setErrorReporter(ErrorReporter ReportError) {
@@ -343,17 +344,17 @@ public:
void reportError(Error Err) { ReportError(std::move(Err)); }
/// @brief Allocate a module key for a new module to add to the JIT.
- VModuleKey allocateVModule();
+ VModuleKey allocateVModule() { return ++LastKey; }
/// @brief Return a module key to the ExecutionSession so that it can be
/// re-used. This should only be done once all resources associated
//// with the original key have been released.
- void releaseVModule(VModuleKey Key);
+ void releaseVModule(VModuleKey Key) { /* FIXME: Recycle keys */ }
public:
static void logErrorsToStdErr(Error Err);
- SymbolStringPool &SSP;
+ std::shared_ptr<SymbolStringPool> SSP;
VModuleKey LastKey = 0;
ErrorReporter ReportError = logErrorsToStdErr;
};
OpenPOWER on IntegriCloud