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 {
101
101
for (const Global *G : Globals) {
102
102
const Descriptor *Desc = G->block ()->getDescriptor ();
103
103
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
+ }
104
112
Desc->dump (OS);
105
113
OS << " \n " ;
106
114
++GI;
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ unsigned Program::createGlobalString(const StringLiteral *S) {
102
102
return I;
103
103
}
104
104
105
- Pointer Program::getPtrGlobal (unsigned Idx) {
105
+ Pointer Program::getPtrGlobal (unsigned Idx) const {
106
106
assert (Idx < Globals.size ());
107
107
return Pointer (Globals[Idx]->block ());
108
108
}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class Program final {
67
67
unsigned createGlobalString (const StringLiteral *S);
68
68
69
69
// / Returns a pointer to a global.
70
- Pointer getPtrGlobal (unsigned Idx);
70
+ Pointer getPtrGlobal (unsigned Idx) const ;
71
71
72
72
// / Returns the value of a global.
73
73
Block *getGlobal (unsigned Idx) {
You can’t perform that action at this time.
0 commit comments