Skip to content

Commit

Permalink
Unloaded Decls are now put back into CodeGen, no need to mark used.
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel-Naumann committed Nov 7, 2016
1 parent 1e10357 commit f6c5426
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
25 changes: 0 additions & 25 deletions interpreter/cling/lib/Interpreter/IncrementalParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 0 additions & 6 deletions interpreter/cling/lib/Interpreter/IncrementalParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion interpreter/cling/lib/Interpreter/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f6c5426

Please sign in to comment.