diff --git a/include/cling/Interpreter/Transaction.h b/include/cling/Interpreter/Transaction.h index 9d936076..be3c807c 100644 --- a/include/cling/Interpreter/Transaction.h +++ b/include/cling/Interpreter/Transaction.h @@ -268,22 +268,7 @@ namespace cling { /// ///\param[in] nested - The transaction to be nested. /// - void addNestedTransaction(Transaction* nested) { - // Create lazily the list - if (!m_NestedTransactions) - m_NestedTransactions.reset(new NestedTransactions()); - - // Lazy create the container on first append. - if (!m_DeclQueue) - m_DeclQueue.reset(new DeclQueue()); - - nested->setParent(this); - // Leave a marker in the parent transaction, where the nested transaction - // started. - DelayCallInfo marker(clang::DeclGroupRef(), Transaction::kCCINone); - m_DeclQueue->push_back(marker); - m_NestedTransactions->push_back(nested); - } + void addNestedTransaction(Transaction* nested); ///\brief Removes a nested transaction. /// diff --git a/lib/Interpreter/Transaction.cpp b/lib/Interpreter/Transaction.cpp index 95d67fe1..1d459102 100644 --- a/lib/Interpreter/Transaction.cpp +++ b/lib/Interpreter/Transaction.cpp @@ -26,6 +26,24 @@ namespace cling { } } + void Transaction::addNestedTransaction(Transaction* nested) { + // Create lazily the list + if (!m_NestedTransactions) + m_NestedTransactions.reset(new NestedTransactions()); + + // Lazy create the container on first append. + if (!m_DeclQueue) + m_DeclQueue.reset(new DeclQueue()); + + nested->setParent(this); + // Leave a marker in the parent transaction, where the nested transaction + // started. + DelayCallInfo marker(clang::DeclGroupRef(), Transaction::kCCINone); + m_DeclQueue->push_back(marker); + m_NestedTransactions->push_back(nested); + } + + void Transaction::removeNestedTransaction(Transaction* nested) { assert(hasNestedTransactions() && "Does not contain nested transactions"); int nestedPos = -1;