Create transactions only if codegen (not rootcling):

The transactions are useful to buffer Decls before sending them to CodeGen,
to verify semantic validity before emitting. If there is no codegen,
DeclCollecting them wastes CPU cycles during PCH generation time
because all headers are in one single transaction. Of course this also
speeds up regular rootcling invocations.
This commit is contained in:
Axel Naumann 2019-06-27 18:55:56 +02:00 committed by SFT Nightlies
parent 8f20c8c6a1
commit 70df14a1c7

View File

@ -194,11 +194,15 @@ namespace cling {
if (DGR.isNull())
return true;
if (!m_Consumer)
return true;
assertHasTransaction(m_CurTransaction);
Transaction::DelayCallInfo DCI(DGR, Transaction::kCCIHandleTopLevelDecl);
m_CurTransaction->append(DCI);
if (!m_Consumer
|| getTransaction()->getIssuedDiags() == Transaction::kErrors)
if (getTransaction()->getIssuedDiags() == Transaction::kErrors)
return true;
if (comesFromASTReader(DGR)) {