diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index c740aecf32f15..2da4eb772589f 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -626,7 +626,7 @@ namespace { /// Allocate storage for a parameter of a function call made in this frame. APValue &createParam(CallRef Args, const ParmVarDecl *PVD, LValue &LV); - void describe(llvm::raw_ostream &OS) override; + void describe(llvm::raw_ostream &OS) const override; Frame *getCaller() const override { return Caller; } SourceLocation getCallLocation() const override { return CallLoc; } @@ -1914,7 +1914,7 @@ APValue *EvalInfo::createHeapAlloc(const Expr *E, QualType T, LValue &LV) { } /// Produce a string describing the given constexpr call. -void CallStackFrame::describe(raw_ostream &Out) { +void CallStackFrame::describe(raw_ostream &Out) const { unsigned ArgIndex = 0; bool IsMemberCall = isa(Callee) && !isa(Callee) && diff --git a/clang/lib/AST/Interp/Frame.h b/clang/lib/AST/Interp/Frame.h index b9a0ea9412f83..304f0d108cab7 100644 --- a/clang/lib/AST/Interp/Frame.h +++ b/clang/lib/AST/Interp/Frame.h @@ -27,7 +27,7 @@ class Frame { virtual ~Frame(); /// Generates a human-readable description of the call site. - virtual void describe(llvm::raw_ostream &OS) = 0; + virtual void describe(llvm::raw_ostream &OS) const = 0; /// Returns a pointer to the caller frame. virtual Frame *getCaller() const = 0; diff --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp index 14b55bea88206..d1b6c0d68041e 100644 --- a/clang/lib/AST/Interp/InterpFrame.cpp +++ b/clang/lib/AST/Interp/InterpFrame.cpp @@ -144,7 +144,7 @@ void print(llvm::raw_ostream &OS, const Pointer &P, ASTContext &Ctx, } } -void InterpFrame::describe(llvm::raw_ostream &OS) { +void InterpFrame::describe(llvm::raw_ostream &OS) const { const FunctionDecl *F = getCallee(); if (const auto *M = dyn_cast(F); M && M->isInstance() && !isa(F)) { diff --git a/clang/lib/AST/Interp/InterpFrame.h b/clang/lib/AST/Interp/InterpFrame.h index 7988e74a61fe8..ce58fb8d3f84e 100644 --- a/clang/lib/AST/Interp/InterpFrame.h +++ b/clang/lib/AST/Interp/InterpFrame.h @@ -50,7 +50,7 @@ class InterpFrame final : public Frame { void popArgs(); /// Describes the frame with arguments for diagnostic purposes. - void describe(llvm::raw_ostream &OS) override; + void describe(llvm::raw_ostream &OS) const override; /// Returns the parent frame object. Frame *getCaller() const override;