[clang] ddff70c - [clang][Interp][NFC] Make InterpFrame::describe() more const-correct

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 00:05:03 PDT 2023


Author: Timm Bäder
Date: 2023-05-31T09:01:57+02:00
New Revision: ddff70cb4b0017489d98bf301a5bcc4f9fa4afab

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

LOG: [clang][Interp][NFC] Make InterpFrame::describe() more const-correct

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpFrame.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp
index 6acfbd3fa614..e20f283c2855 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<ValueDecl>(D)) {
+      if (const auto *VD = dyn_cast<ValueDecl>(D)) {
         OS << *VD;
         return;
       }
       // Base classes.
-      if (isa<RecordDecl>(D)) {
+      if (isa<RecordDecl>(D))
         return;
-      }
     }
     // Temporary expression.
-    if (auto *E = Desc->asExpr()) {
+    if (const auto *E = Desc->asExpr()) {
       E->printPretty(OS, nullptr, Ctx.getPrintingPolicy());
       return;
     }


        


More information about the cfe-commits mailing list