Skip to content

Commit

Permalink
[clang][Interp][NFC] Make InterpFrame::describe() more const-correct
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed May 31, 2023
1 parent 39f4bd2 commit ddff70c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions clang/lib/AST/Interp/InterpFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ddff70c

Please sign in to comment.