7c08e8c678
git-svn-id: http://root.cern.ch/svn/root/trunk@46017 27541ba8-7e3a-0410-8455-c3a389f83636
61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
//------------------------------------------------------------------------------
|
|
// CLING - the C++ LLVM-based InterpreterG :)
|
|
// version: $Id$
|
|
// author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
|
|
//------------------------------------------------------------------------------
|
|
|
|
#ifndef CLING_VALUE_PRINTER_SYNTHESIZER_H
|
|
#define CLING_VALUE_PRINTER_SYNTHESIZER_H
|
|
|
|
#include "TransactionTransformer.h"
|
|
|
|
#include "llvm/ADT/OwningPtr.h"
|
|
|
|
namespace clang {
|
|
class ASTContext;
|
|
class CompoundStmt;
|
|
class DeclGroupRef;
|
|
class Expr;
|
|
class Sema;
|
|
}
|
|
|
|
namespace llvm {
|
|
class raw_ostream;
|
|
}
|
|
|
|
namespace cling {
|
|
|
|
class ValuePrinterSynthesizer : public TransactionTransformer {
|
|
|
|
private:
|
|
///\brief Needed for the AST transformations, owned by Sema.
|
|
///
|
|
clang::ASTContext* m_Context;
|
|
|
|
///\brief Stream to dump values into.
|
|
///
|
|
llvm::OwningPtr<llvm::raw_ostream> m_ValuePrinterStream;
|
|
|
|
public:
|
|
///\ brief Construct the value printer synthesizer.
|
|
///
|
|
///\param[in] S - The semantic analysis object
|
|
///\param[in] Stream - The output stream where the value printer will write
|
|
/// to. Defaults to std::cout. Owns the stream.
|
|
ValuePrinterSynthesizer(clang::Sema* S, llvm::raw_ostream* Stream);
|
|
|
|
virtual ~ValuePrinterSynthesizer();
|
|
|
|
virtual void Transform();
|
|
|
|
private:
|
|
bool tryAttachVP(clang::DeclGroupRef DGR);
|
|
clang::Expr* SynthesizeCppVP(clang::Expr* E);
|
|
clang::Expr* SynthesizeVP(clang::Expr* E);
|
|
unsigned ClearNullStmts(clang::CompoundStmt* CS);
|
|
};
|
|
|
|
} // namespace cling
|
|
|
|
#endif // CLING_DECL_EXTRACTOR_H
|