2012-09-05 09:37:39 +00:00
//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
//------------------------------------------------------------------------------
# include "DeclCollector.h"
2012-10-02 10:30:25 +00:00
# include "cling/Interpreter/Transaction.h"
2012-09-05 09:37:39 +00:00
# include "clang/AST/Decl.h"
2012-12-03 16:28:24 +00:00
# include "clang/AST/DeclCXX.h"
2012-09-05 09:37:39 +00:00
# include "clang/AST/DeclGroup.h"
using namespace clang ;
namespace cling {
// pin the vtable here.
DeclCollector : : ~ DeclCollector ( ) {
}
bool DeclCollector : : HandleTopLevelDecl ( DeclGroupRef DGR ) {
2012-12-03 16:28:24 +00:00
Transaction : : DelayCallInfo DCI ( DGR , Transaction : : kCCIHandleTopLevelDecl ) ;
m_CurTransaction - > append ( DCI ) ;
2012-09-05 09:37:39 +00:00
return true ;
}
void DeclCollector : : HandleInterestingDecl ( DeclGroupRef DGR ) {
2012-12-03 16:28:24 +00:00
Transaction : : DelayCallInfo DCI ( DGR , Transaction : : kCCIHandleInterestingDecl ) ;
m_CurTransaction - > append ( DCI ) ;
2012-09-05 09:37:39 +00:00
}
void DeclCollector : : HandleTagDeclDefinition ( TagDecl * TD ) {
2012-12-03 16:28:24 +00:00
Transaction : : DelayCallInfo DCI ( DeclGroupRef ( TD ) ,
Transaction : : kCCIHandleTagDeclDefinition ) ;
m_CurTransaction - > append ( DCI ) ;
2012-09-05 09:37:39 +00:00
}
2012-11-18 20:52:41 +00:00
void DeclCollector : : HandleVTable ( CXXRecordDecl * RD , bool DefinitionRequired ) {
2012-12-03 16:28:24 +00:00
Transaction : : DelayCallInfo DCI ( DeclGroupRef ( RD ) ,
Transaction : : kCCIHandleVTable ) ;
m_CurTransaction - > append ( DCI ) ;
2012-11-18 22:44:58 +00:00
// Intentional no-op. It comes through Sema::DefineUsedVTables, which
// comes either Sema::ActOnEndOfTranslationUnit or while instantiating a
// template. In our case we will do it on transaction commit, without
// keeping track of used vtables, because we have cases where we bypass the
// clang/AST and directly ask the module so that we have to generate
// everything without extra smartness.
2012-09-05 09:37:39 +00:00
}
void DeclCollector : : CompleteTentativeDefinition ( VarDecl * VD ) {
2012-11-18 20:52:41 +00:00
assert ( 0 & & " Not implemented yet! " ) ;
2012-09-05 09:37:39 +00:00
}
void DeclCollector : : HandleTranslationUnit ( ASTContext & Ctx ) {
}
2012-12-12 08:08:56 +00:00
void DeclCollector : : HandleCXXImplicitFunctionInstantiation ( FunctionDecl * D ) {
Transaction : : DelayCallInfo DCI ( DeclGroupRef ( D ) ,
Transaction : : kCCIHandleCXXImplicitFunctionInstantiation ) ;
m_CurTransaction - > append ( DCI ) ;
}
void DeclCollector : : HandleCXXStaticMemberVarInstantiation ( VarDecl * D ) {
Transaction : : DelayCallInfo DCI ( DeclGroupRef ( D ) ,
Transaction : : kCCIHandleCXXStaticMemberVarInstantiation ) ;
m_CurTransaction - > append ( DCI ) ;
}
2012-09-05 09:37:39 +00:00
} // namespace cling