[clang] a83079f - [clang][ConstExpr][NFC] Make Frame::describe() const

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 9 06:49:53 PDT 2023


Author: Timm Bäder
Date: 2023-07-09T15:49:32+02:00
New Revision: a83079f754a529b9a6d21480f834269b847220d3

URL: https://github.com/llvm/llvm-project/commit/a83079f754a529b9a6d21480f834269b847220d3
DIFF: https://github.com/llvm/llvm-project/commit/a83079f754a529b9a6d21480f834269b847220d3.diff

LOG: [clang][ConstExpr][NFC] Make Frame::describe() const

Added: 
    

Modified: 
    clang/lib/AST/ExprConstant.cpp
    clang/lib/AST/Interp/Frame.h
    clang/lib/AST/Interp/InterpFrame.cpp
    clang/lib/AST/Interp/InterpFrame.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index c740aecf32f154..2da4eb772589f9 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<CXXMethodDecl>(Callee) &&
                       !isa<CXXConstructorDecl>(Callee) &&

diff  --git a/clang/lib/AST/Interp/Frame.h b/clang/lib/AST/Interp/Frame.h
index b9a0ea9412f838..304f0d108cab7b 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 14b55bea882068..d1b6c0d68041e5 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<CXXMethodDecl>(F);
       M && M->isInstance() && !isa<CXXConstructorDecl>(F)) {

diff  --git a/clang/lib/AST/Interp/InterpFrame.h b/clang/lib/AST/Interp/InterpFrame.h
index 7988e74a61fe83..ce58fb8d3f84eb 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;


        


More information about the cfe-commits mailing list