Add comment explaining (part of) the bootstrap sequencing.

This commit is contained in:
Axel Naumann 2014-03-23 21:08:48 +01:00 committed by sftnight
parent b44c7c69c0
commit 7390550dfe
2 changed files with 7 additions and 2 deletions

View File

@ -98,7 +98,6 @@ namespace cling {
const std::string& PCHFileName
= m_CI->getInvocation ().getPreprocessorOpts().ImplicitPCHInclude;
if (!PCHFileName.empty()) {
Transaction* CurT = beginTransaction(CO);
m_CI->createPCHExternalASTSource(PCHFileName,
true /*DisablePCHValidation*/,
@ -124,8 +123,12 @@ namespace cling {
if (External)
External->StartTranslationUnit(m_Consumer);
// DO NOT commit the transactions here: static initialization in these
// transactions requires gCling through local_cxa_atexit(), but that has not
// been defined yet!
if (Transaction* EndedT = endTransaction(CurT))
result.push_back(EndedT);
}
IncrementalParser::~IncrementalParser() {

View File

@ -198,7 +198,9 @@ namespace cling {
else
IncludeCRuntime();
for (llvm::SmallVectorImpl<Transaction*>::const_iterator
// Commit the transactions, now that gCling is set up. It is needed for
// static initialization in these transactions through local_cxa_atexit().
for (llvm::SmallVectorImpl<Transaction*>::const_iterator
I = IncrParserTransactions.begin(), E = IncrParserTransactions.end();
I != E; ++I)
m_IncrParser->commitTransaction(*I);