[clang] c1dd7f9 - [clang][Interp][NFC] Print more info in Program::dump()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 28 03:49:58 PDT 2022


Author: Timm Bäder
Date: 2022-10-28T12:49:38+02:00
New Revision: c1dd7f90132a8a767d91f9b2b3e2bf1a9d7aa04f

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

LOG: [clang][Interp][NFC] Print more info in Program::dump()

Number of functions and global variables is useful to know.

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 9fc22f2b6ea0..db68887f0558 100644
--- a/clang/lib/AST/Interp/Disasm.cpp
+++ b/clang/lib/AST/Interp/Disasm.cpp
@@ -72,6 +72,10 @@ LLVM_DUMP_METHOD void Function::dump(llvm::raw_ostream &OS) const {
 LLVM_DUMP_METHOD void Program::dump() const { dump(llvm::errs()); }
 
 LLVM_DUMP_METHOD void Program::dump(llvm::raw_ostream &OS) const {
+  OS << ":: Program\n";
+  OS << "Global Variables: " << Globals.size() << "\n";
+  OS << "Functions: " << Funcs.size() << "\n";
+  OS << "\n";
   for (auto &Func : Funcs) {
     Func.second->dump();
   }


        


More information about the cfe-commits mailing list