Use the std::deque to implement the first and last transaction accessors.
This commit is contained in:
parent
f54ad7450e
commit
2f3cdedfde
@ -46,8 +46,7 @@ namespace cling {
|
|||||||
IncrementalParser::IncrementalParser(Interpreter* interp,
|
IncrementalParser::IncrementalParser(Interpreter* interp,
|
||||||
int argc, const char* const *argv,
|
int argc, const char* const *argv,
|
||||||
const char* llvmdir):
|
const char* llvmdir):
|
||||||
m_Interpreter(interp), m_Consumer(0), m_FirstTransaction(0),
|
m_Interpreter(interp), m_Consumer(0) {
|
||||||
m_LastTransaction(0) {
|
|
||||||
|
|
||||||
CompilerInstance* CI
|
CompilerInstance* CI
|
||||||
= CIFactory::createCI(0, argc, argv, llvmdir);
|
= CIFactory::createCI(0, argc, argv, llvmdir);
|
||||||
@ -175,15 +174,11 @@ namespace cling {
|
|||||||
|
|
||||||
m_Consumer->setTransaction(NewCurT);
|
m_Consumer->setTransaction(NewCurT);
|
||||||
|
|
||||||
if (!m_FirstTransaction) {
|
if (NewCurT != getLastTransaction()) {
|
||||||
m_FirstTransaction = NewCurT;
|
if (getLastTransaction())
|
||||||
m_LastTransaction = NewCurT;
|
m_Transactions.back()->setNext(NewCurT);
|
||||||
|
m_Transactions.push_back(NewCurT);
|
||||||
}
|
}
|
||||||
else if (NewCurT != m_LastTransaction){
|
|
||||||
m_LastTransaction->setNext(NewCurT);
|
|
||||||
m_LastTransaction = NewCurT; // takes the ownership
|
|
||||||
}
|
|
||||||
|
|
||||||
return NewCurT;
|
return NewCurT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user