2012-09-05 13:37:39 +04:00
//--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
2013-10-21 23:35:33 +04:00
// version: $Id: a88f59662c0204c76ab2204361d9f64b1e10fcfc $
2012-09-05 13:37:39 +04:00
// author: Vassil Vassilev <vvasilev@cern.ch>
//------------------------------------------------------------------------------
# ifndef CLING_AST_NODE_ERASER
# define CLING_AST_NODE_ERASER
2013-10-21 23:35:33 +04:00
namespace llvm {
class ExecutionEngine ;
}
2012-09-05 13:37:39 +04:00
namespace clang {
class Sema ;
}
namespace cling {
class Transaction ;
///\brief A simple eraser class that removes already created AST Nodes.
///
class ASTNodeEraser {
private :
clang : : Sema * m_Sema ;
2013-10-21 23:35:33 +04:00
llvm : : ExecutionEngine * m_EEngine ;
2012-09-05 13:37:39 +04:00
public :
2013-10-21 23:35:33 +04:00
ASTNodeEraser ( clang : : Sema * S , llvm : : ExecutionEngine * EE ) ;
2012-09-05 13:37:39 +04:00
~ ASTNodeEraser ( ) ;
///\brief Rolls back given transaction from the AST.
///
/// Removing includes reseting various internal stuctures in the compiler to
/// their previous states. For example it resets the lookup tables if the
/// declaration has name and can be looked up; Reverts the redeclaration
/// chain if the declaration was redeclarable and so on.
/// Note1: that the code generated for the declaration is not removed yet.
/// Note2: does not do dependency analysis.
///
///\param[in] T - The transaction to be removed.
///\returns true on success.
///
bool RevertTransaction ( const Transaction * T ) ;
} ;
} // end namespace cling
# endif // CLING_AST_NODE_ERASER