File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,14 @@ LLVM_DUMP_METHOD void Program::dump(llvm::raw_ostream &OS) const {
101101 for (const Global *G : Globals) {
102102 const Descriptor *Desc = G->block ()->getDescriptor ();
103103 OS << GI << " : " << (void *)G->block () << " " ;
104+ {
105+ Pointer GP = getPtrGlobal (GI);
106+ ColorScope SC (OS, true ,
107+ GP.isInitialized ()
108+ ? TerminalColor{llvm::raw_ostream::GREEN, false }
109+ : TerminalColor{llvm::raw_ostream::RED, false });
110+ OS << (GP.isInitialized () ? " initialized " : " uninitialized " );
111+ }
104112 Desc->dump (OS);
105113 OS << " \n " ;
106114 ++GI;
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ unsigned Program::createGlobalString(const StringLiteral *S) {
102102 return I;
103103}
104104
105- Pointer Program::getPtrGlobal (unsigned Idx) {
105+ Pointer Program::getPtrGlobal (unsigned Idx) const {
106106 assert (Idx < Globals.size ());
107107 return Pointer (Globals[Idx]->block ());
108108}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class Program final {
6767 unsigned createGlobalString (const StringLiteral *S);
6868
6969 // / Returns a pointer to a global.
70- Pointer getPtrGlobal (unsigned Idx);
70+ Pointer getPtrGlobal (unsigned Idx) const ;
7171
7272 // / Returns the value of a global.
7373 Block *getGlobal (unsigned Idx) {
You can’t perform that action at this time.
0 commit comments