[clang] 5f2aa91 - [clang][Interp][NFC] Don't try to dump uninitialized global variables

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 5 04:27:37 PDT 2024


Author: Timm Bäder
Date: 2024-06-05T13:24:22+02:00
New Revision: 5f2aa912766e4d48a5b46afa7ad9e99a41a51ee8

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

LOG: [clang][Interp][NFC] Don't try to dump uninitialized global variables

They don't contain anything useful.

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 ccdc96a79436d..e442c6c709f14 100644
--- a/clang/lib/AST/Interp/Disasm.cpp
+++ b/clang/lib/AST/Interp/Disasm.cpp
@@ -150,7 +150,7 @@ LLVM_DUMP_METHOD void Program::dump(llvm::raw_ostream &OS) const {
     }
     Desc->dump(OS);
     OS << "\n";
-    if (Desc->isPrimitive() && !Desc->isDummy()) {
+    if (GP.isInitialized() && Desc->isPrimitive() && !Desc->isDummy()) {
       OS << "   ";
       {
         ColorScope SC(OS, true, {llvm::raw_ostream::BRIGHT_CYAN, false});


        


More information about the cfe-commits mailing list