Unloaded Decls are now put back into CodeGen, no need to mark used.

This commit is contained in:
Axel Naumann 2016-11-04 10:18:41 +01:00 committed by sftnight
parent 4cec420bf1
commit 3711cd0658
3 changed files with 0 additions and 32 deletions

View File

@ -417,31 +417,6 @@ namespace cling {
}
void IncrementalParser::markWholeTransactionAsUsed(Transaction* T) const {
ASTContext& C = m_CI->getASTContext();
for (Transaction::const_iterator I = T->decls_begin(), E = T->decls_end();
I != E; ++I) {
// Copy DCI; it might get relocated below.
Transaction::DelayCallInfo DCI = *I;
// FIXME: implement for multiple decls in a DGR.
assert(DCI.m_DGR.isSingleDecl());
Decl* D = DCI.m_DGR.getSingleDecl();
if (!D->hasAttr<clang::UsedAttr>())
D->addAttr(::new (D->getASTContext())
clang::UsedAttr(D->getSourceRange(), D->getASTContext(),
0/*AttributeSpellingListIndex*/));
}
for (Transaction::iterator I = T->deserialized_decls_begin(),
E = T->deserialized_decls_end(); I != E; ++I) {
// FIXME: implement for multiple decls in a DGR.
assert(I->m_DGR.isSingleDecl());
Decl* D = I->m_DGR.getSingleDecl();
if (!D->hasAttr<clang::UsedAttr>())
D->addAttr(::new (C) clang::UsedAttr(D->getSourceRange(), C,
0/*AttributeSpellingListIndex*/));
}
}
void IncrementalParser::emitTransaction(Transaction* T) {
for (auto DI = T->decls_begin(), DE = T->decls_end(); DI != DE; ++DI)
m_Consumer->HandleTopLevelDecl(DI->m_DGR);

View File

@ -192,12 +192,6 @@ namespace cling {
void printTransactionStructure() const;
///\brief Adds a UsedAttr to all decls in the transaction.
///
///\param[in] T - the transaction for which all decls will get a UsedAttr.
///
void markWholeTransactionAsUsed(Transaction* T) const;
///\brief Runs the static initializers created by codegening a transaction.
///
///\param[in] T - the transaction for which to run the initializers.

View File

@ -637,7 +637,6 @@ namespace cling {
assert(!isInSyntaxOnlyMode() && "No CodeGenerator?");
m_IncrParser->emitTransaction(T);
m_IncrParser->addTransaction(T);
m_IncrParser->markWholeTransactionAsUsed(T);
T->setState(Transaction::kCollecting);
auto PRT = m_IncrParser->endTransaction(T);
m_IncrParser->commitTransaction(PRT);