From cb29e6e5291c961912042b5f954490398f71fb9d Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Mon, 12 May 2014 15:43:43 +0200 Subject: [PATCH] Add printing utility functions to the cling::Value. --- include/cling/Interpreter/Value.h | 7 +++++++ lib/Interpreter/Value.cpp | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/include/cling/Interpreter/Value.h b/include/cling/Interpreter/Value.h index 2c956fc2..ebfd4588 100644 --- a/include/cling/Interpreter/Value.h +++ b/include/cling/Interpreter/Value.h @@ -10,6 +10,10 @@ #ifndef CLING_VALUE_H #define CLING_VALUE_H +namespace llvm { + class raw_ostream; +} + namespace clang { class ASTContext; class QualType; @@ -154,6 +158,9 @@ namespace cling { /// Values referencing an object are treated as pointers to the object. template T simplisticCastAs() const; + + void print(llvm::raw_ostream& Out) const; + void dump() const; }; template diff --git a/lib/Interpreter/Value.cpp b/lib/Interpreter/Value.cpp index b0c7fda8..b7a61607 100644 --- a/lib/Interpreter/Value.cpp +++ b/lib/Interpreter/Value.cpp @@ -245,4 +245,12 @@ void* Value::GetDtorWrapperPtr(const clang::RecordDecl* RD, return interp.compileFunction(funcname, code, true /*ifUniq*/, false /*withAccessControl*/); } + + void Value::print(llvm::raw_ostream& Out) const { + + } + + void Value::dump() const { + print(llvm::errs()); + } } // namespace cling