[PATCH] D141831: [clang][Interp] Fix double-printing in InterpFrame::describe()

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 31 06:26:12 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd472c55fa28a: [clang][Interp] Fix double-printing InterpFrame::describe() (authored by tbaeder).

Changed prior to commit:
  https://reviews.llvm.org/D141831?vs=489469&id=510010#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141831/new/

https://reviews.llvm.org/D141831

Files:
  clang/lib/AST/Interp/InterpFrame.cpp
  clang/test/AST/Interp/constexpr-nqueens.cpp


Index: clang/test/AST/Interp/constexpr-nqueens.cpp
===================================================================
--- clang/test/AST/Interp/constexpr-nqueens.cpp
+++ clang/test/AST/Interp/constexpr-nqueens.cpp
@@ -6,9 +6,6 @@
 /// Board constructors.
 /// This tests that InterpFrame::describe().
 
-// FIXME: With the new interpreter, most of the described frames are
-//  currently broken in one way or another.
-
 typedef unsigned long uint64_t;
 
 struct Board {
Index: clang/lib/AST/Interp/InterpFrame.cpp
===================================================================
--- clang/lib/AST/Interp/InterpFrame.cpp
+++ clang/lib/AST/Interp/InterpFrame.cpp
@@ -126,6 +126,9 @@
     F = F.isArrayElement() ? F.getArray().expand() : F.getBase();
   }
 
+  // Drop the first pointer since we print it unconditionally anyway.
+  Levels.erase(Levels.begin());
+
   printDesc(P.getDeclDesc());
   for (const auto &It : Levels) {
     if (It.inArray()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141831.510010.patch
Type: text/x-patch
Size: 957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230331/354cebf2/attachment-0001.bin>


More information about the cfe-commits mailing list