File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
include/clang/Interpreter Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ class Interpreter {
197197 // / @name Value and pretty printing support
198198 // / @{
199199
200- std::string ValueDataToString (const Value &V);
200+ std::string ValueDataToString (const Value &V) const ;
201201 std::string ValueTypeToString (const Value &V) const ;
202202
203203 llvm::Expected<Expr *> convertExprToValue (Expr *E);
Original file line number Diff line number Diff line change @@ -119,9 +119,9 @@ class REPL_EXTERNAL_VISIBILITY Value {
119119 ~Value ();
120120
121121 void printType (llvm::raw_ostream &Out) const ;
122- void printData (llvm::raw_ostream &Out);
123- void print (llvm::raw_ostream &Out);
124- void dump ();
122+ void printData (llvm::raw_ostream &Out) const ;
123+ void print (llvm::raw_ostream &Out) const ;
124+ void dump () const ;
125125 void clear ();
126126
127127 ASTContext &getASTContext ();
Original file line number Diff line number Diff line change @@ -180,14 +180,15 @@ static std::string CharPtrToString(const char *Ptr) {
180180namespace clang {
181181
182182struct ValueRef : public Value {
183- ValueRef (Interpreter *In, void *Ty) : Value(In, Ty) {
183+ ValueRef (const Interpreter *In, void *Ty)
184+ : Value(const_cast <Interpreter *>(In), Ty) {
184185 // Tell the base class to not try to deallocate if it manages the value.
185186 IsManuallyAlloc = false ;
186187 }
187188 void setData (long double D) { Data.m_LongDouble = D; }
188189};
189190
190- std::string Interpreter::ValueDataToString (const Value &V) {
191+ std::string Interpreter::ValueDataToString (const Value &V) const {
191192 Sema &S = getCompilerInstance ()->getSema ();
192193 ASTContext &Ctx = S.getASTContext ();
193194
Original file line number Diff line number Diff line change @@ -254,18 +254,18 @@ const ASTContext &Value::getASTContext() const {
254254 return getInterpreter ().getASTContext ();
255255}
256256
257- void Value::dump () { print (llvm::outs ()); }
257+ void Value::dump () const { print (llvm::outs ()); }
258258
259259void Value::printType (llvm::raw_ostream &Out) const {
260260 Out << Interp->ValueTypeToString (*this );
261261}
262262
263- void Value::printData (llvm::raw_ostream &Out) {
263+ void Value::printData (llvm::raw_ostream &Out) const {
264264 Out << Interp->ValueDataToString (*this );
265265}
266266// FIXME: We do not support the multiple inheritance case where one of the base
267267// classes has a pretty-printer and the other does not.
268- void Value::print (llvm::raw_ostream &Out) {
268+ void Value::print (llvm::raw_ostream &Out) const {
269269 assert (OpaqueType != nullptr && " Can't print default Value" );
270270
271271 // Don't even try to print a void or an invalid type, it doesn't make sense.
You can’t perform that action at this time.
0 commit comments