cling/lib/Interpreter/AutoloadingTransform.cpp
Manasij Mukherjee f474d63079 Generation of forward declarations of top level decls in an input file.
Consists of:
  ForwardDeclPrinter, adapted from clang::DeclPrinter
  Interpterer::GenerateAutoloadingMap for invoking the functionality
  It has hardcoded checks to prevent ForwardDeclPrinter from visiting decls from
standard library files. This restriction will be lifted after the
issues specifyed in the tests are fixed.
  Test cases for code which FowrardDeclPrinter can not deal with properly
2014-06-23 14:37:03 +02:00

34 lines
894 B
C++

#include "AutoloadingTransform.h"
#include "cling/Interpreter/Transaction.h"
#include "clang/Sema/Sema.h"
using namespace clang;
namespace cling {
AutoloadingTransform::AutoloadingTransform(clang::Sema* S)
: TransactionTransformer(S) {
}
AutoloadingTransform::~AutoloadingTransform()
{}
void AutoloadingTransform::Transform() {
const Transaction* T = getTransaction();
for (Transaction::const_iterator I = T->decls_begin(), E = T->decls_end();
I != E; ++I) {
Transaction::DelayCallInfo DCI = *I;
for (DeclGroupRef::iterator J = DCI.m_DGR.begin(),
JE = DCI.m_DGR.end(); J != JE; ++J) {
//FIXME: Enable when safe !
// if ( (*J)->hasAttr<AnnotateAttr>() /*FIXME: && CorrectCallbackLoaded() how ? */ )
// clang::Decl::castToDeclContext(*J)->setHasExternalLexicalStorage();
}
}
}
} // end namespace cling