Add the transaction to define its lifetime.
This should be migrated to use unique_ptr in the interfaces instead of relying on comments...
This commit is contained in:
parent
9bd2a08dd2
commit
eb75ab36ef
@ -501,7 +501,7 @@ namespace cling {
|
||||
///\brief Generates code for all Decls of a transaction.
|
||||
///
|
||||
/// @param[in] T - The cling::Transaction that contains the declarations and
|
||||
/// the compilation/generation options.
|
||||
/// the compilation/generation options. Takes ownership!
|
||||
///
|
||||
///\returns Whether the operation was fully successful.
|
||||
///
|
||||
|
@ -175,6 +175,12 @@ namespace cling {
|
||||
///
|
||||
const Transaction* getCurrentTransaction() const;
|
||||
|
||||
|
||||
///\brief Add a user-generated transaction.
|
||||
void addTransaction(Transaction* T) {
|
||||
m_Transactions.push_back(T);
|
||||
}
|
||||
|
||||
///\brief Returns the list of transactions seen by the interpreter.
|
||||
/// Intentionally makes a copy - that function is meant to be use for debug
|
||||
/// purposes.
|
||||
|
@ -626,8 +626,9 @@ namespace cling {
|
||||
|
||||
Interpreter::CompilationResult Interpreter::emitAllDecls(Transaction* T) {
|
||||
assert(!isInSyntaxOnlyMode() && "No CodeGenerator?");
|
||||
m_IncrParser->addTransaction(T);
|
||||
m_IncrParser->markWholeTransactionAsUsed(T);
|
||||
m_IncrParser->codeGenTransaction(T);
|
||||
m_IncrParser->commitTransaction(T);
|
||||
|
||||
// The static initializers might run anything and can thus cause more
|
||||
// decls that need to end up in a transaction. But this one is done
|
||||
|
Loading…
x
Reference in New Issue
Block a user