Skip to content

Commit

Permalink
Unloaded declarations are now put back into CodeGen; no need to mark …
Browse files Browse the repository at this point in the history
…them used.
  • Loading branch information
Axel-Naumann committed Nov 7, 2016
1 parent 80db0bc commit 1e10357
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
2 changes: 0 additions & 2 deletions interpreter/cling/lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,6 @@ namespace {
std::unique_ptr<cling::DeclCollector>
stateCollector(new cling::DeclCollector());

// Set up the ASTConsumers
CI->getASTContext().setASTMutationListener(stateCollector.get());
// Add the callback keeping track of the macro definitions
PP.addPPCallbacks(stateCollector->MakePPAdapter());
CI->setASTConsumer(std::move(stateCollector));
Expand Down
12 changes: 1 addition & 11 deletions interpreter/cling/lib/Interpreter/DeclCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,7 @@ namespace cling {
// pin the vtable here.
DeclCollector::~DeclCollector() { }

void DeclCollector::AddedCXXImplicitMember(const CXXRecordDecl *RD,
const Decl *D) {
assert(D->isImplicit());
// We need to mark the decls coming from the modules
if (comesFromASTReader(RD) || comesFromASTReader(D)) {
Decl* implicitD = const_cast<Decl*>(D);
implicitD->addAttr(UsedAttr::CreateImplicit(implicitD->getASTContext()));
}
}

ASTTransformer::Result DeclCollector::TransformDecl(Decl* D) const {
ASTTransformer::Result DeclCollector::TransformDecl(Decl* D) const {
// We are sure it's safe to pipe it through the transformers
// Consume late transformers init
for (size_t i = 0; D && i < m_TransactionTransformers.size(); ++i) {
Expand Down
8 changes: 1 addition & 7 deletions interpreter/cling/lib/Interpreter/DeclCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#define CLING_DECL_COLLECTOR_H

#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/Lex/PPCallbacks.h"

#include "ASTTransformer.h"
Expand Down Expand Up @@ -57,8 +56,7 @@ namespace cling {
/// cling::DeclCollector is responsible for appending all the declarations
/// seen by clang.
///
class DeclCollector: public clang::ASTMutationListener,
public clang::ASTConsumer {
class DeclCollector: public clang::ASTConsumer {
private:
///\brief Contains the transaction AST transformers.
///
Expand Down Expand Up @@ -120,10 +118,6 @@ namespace cling {
void MacroDefined(const clang::Token &MacroNameTok,
const clang::MacroDirective *MD);
/// \}
/// \name ASTMutationListeners overrides
virtual void AddedCXXImplicitMember(const clang::CXXRecordDecl *RD,
const clang::Decl *D);
/// \}

/// \{
/// \name ASTConsumer overrides
Expand Down

0 comments on commit 1e10357

Please sign in to comment.