[clang] c2db883 - [clang][Interp][NFC] Print virtual bases in Record::dump()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 26 01:22:21 PDT 2024


Author: Timm Bäder
Date: 2024-04-26T10:21:27+02:00
New Revision: c2db883ff4340b2f70154eca04e3adbc8e0d082c

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

LOG: [clang][Interp][NFC] Print virtual bases in Record::dump()

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Disasm.cpp b/clang/lib/AST/Interp/Disasm.cpp
index e847a237660d07..01cc88ea9a8459 100644
--- a/clang/lib/AST/Interp/Disasm.cpp
+++ b/clang/lib/AST/Interp/Disasm.cpp
@@ -270,8 +270,6 @@ LLVM_DUMP_METHOD void Record::dump(llvm::raw_ostream &OS, unsigned Indentation,
     ++I;
   }
 
-  // FIXME: Virtual bases.
-
   I = 0;
   for (const Record::Field &F : fields()) {
     OS.indent(Indent) << "- Field " << I << ": ";
@@ -282,6 +280,14 @@ LLVM_DUMP_METHOD void Record::dump(llvm::raw_ostream &OS, unsigned Indentation,
     OS << ". Offset " << (Offset + F.Offset) << "\n";
     ++I;
   }
+
+  I = 0;
+  for (const Record::Base &B : virtual_bases()) {
+    OS.indent(Indent) << "- Virtual Base " << I << ". Offset "
+                      << (Offset + B.Offset) << "\n";
+    B.R->dump(OS, Indentation + 1, Offset + B.Offset);
+    ++I;
+  }
 }
 
 LLVM_DUMP_METHOD void Block::dump(llvm::raw_ostream &OS) const {


        


More information about the cfe-commits mailing list