From ddff70cb4b0017489d98bf301a5bcc4f9fa4afab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Wed, 31 May 2023 08:56:19 +0200 Subject: [PATCH] [clang][Interp][NFC] Make InterpFrame::describe() more const-correct --- clang/lib/AST/Interp/InterpFrame.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp index 6acfbd3..e20f283 100644 --- a/clang/lib/AST/Interp/InterpFrame.cpp +++ b/clang/lib/AST/Interp/InterpFrame.cpp @@ -98,20 +98,19 @@ void print(llvm::raw_ostream &OS, const Pointer &P, ASTContext &Ctx, return; } - auto printDesc = [&OS, &Ctx](Descriptor *Desc) { - if (auto *D = Desc->asDecl()) { + auto printDesc = [&OS, &Ctx](const Descriptor *Desc) { + if (const auto *D = Desc->asDecl()) { // Subfields or named values. - if (auto *VD = dyn_cast(D)) { + if (const auto *VD = dyn_cast(D)) { OS << *VD; return; } // Base classes. - if (isa(D)) { + if (isa(D)) return; - } } // Temporary expression. - if (auto *E = Desc->asExpr()) { + if (const auto *E = Desc->asExpr()) { E->printPretty(OS, nullptr, Ctx.getPrintingPolicy()); return; } -- 2.7.4