Outline method.

This commit is contained in:
Vassil Vassilev 2013-07-06 12:16:35 +02:00 committed by sftnight
parent f841f0bc8d
commit 63f1ce5082
2 changed files with 19 additions and 16 deletions

View File

@ -268,22 +268,7 @@ namespace cling {
/// ///
///\param[in] nested - The transaction to be nested. ///\param[in] nested - The transaction to be nested.
/// ///
void addNestedTransaction(Transaction* 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);
}
///\brief Removes a nested transaction. ///\brief Removes a nested transaction.
/// ///

View File

@ -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) { void Transaction::removeNestedTransaction(Transaction* nested) {
assert(hasNestedTransactions() && "Does not contain nested transactions"); assert(hasNestedTransactions() && "Does not contain nested transactions");
int nestedPos = -1; int nestedPos = -1;