@@ -93,6 +93,7 @@ const char *getScopeName(Scope S) {
93
93
raw_ostream &operator <<(raw_ostream &OS, const Block &B) {
94
94
return OS << formatv (" {0:x16}" , B.getAddress ()) << " -- "
95
95
<< formatv (" {0:x16}" , B.getAddress () + B.getSize ()) << " : "
96
+ << " size = " << formatv (" {0:x}" , B.getSize ()) << " , "
96
97
<< (B.isZeroFill () ? " zero-fill" : " content" )
97
98
<< " , align = " << B.getAlignment ()
98
99
<< " , align-ofs = " << B.getAlignmentOffset ()
@@ -126,10 +127,10 @@ raw_ostream &operator<<(raw_ostream &OS, const Symbol &Sym) {
126
127
break ;
127
128
}
128
129
OS << (Sym.isLive () ? ' +' : ' -' )
129
- << " , size = " << formatv (" {0:x8 }" , Sym.getSize ())
130
+ << " , size = " << formatv (" {0:x }" , Sym.getSize ())
130
131
<< " , addr = " << formatv (" {0:x16}" , Sym.getAddress ()) << " ("
131
132
<< formatv (" {0:x16}" , Sym.getAddressable ().getAddress ()) << " + "
132
- << formatv (" {0:x8 }" , Sym.getOffset ());
133
+ << formatv (" {0:x }" , Sym.getOffset ());
133
134
if (Sym.isDefined ())
134
135
OS << " " << Sym.getBlock ().getSection ().getName ();
135
136
OS << " )>" ;
@@ -139,8 +140,33 @@ raw_ostream &operator<<(raw_ostream &OS, const Symbol &Sym) {
139
140
void printEdge (raw_ostream &OS, const Block &B, const Edge &E,
140
141
StringRef EdgeKindName) {
141
142
OS << " edge@" << formatv (" {0:x16}" , B.getAddress () + E.getOffset ()) << " : "
142
- << formatv (" {0:x16}" , B.getAddress ()) << " + " << E.getOffset () << " -- "
143
- << EdgeKindName << " -> " << E.getTarget () << " + " << E.getAddend ();
143
+ << formatv (" {0:x16}" , B.getAddress ()) << " + "
144
+ << formatv (" {0:x}" , E.getOffset ()) << " -- " << EdgeKindName << " -> " ;
145
+
146
+ auto &TargetSym = E.getTarget ();
147
+ if (TargetSym.hasName ())
148
+ OS << TargetSym.getName ();
149
+ else {
150
+ auto &TargetBlock = TargetSym.getBlock ();
151
+ auto &TargetSec = TargetBlock.getSection ();
152
+ JITTargetAddress SecAddress = ~JITTargetAddress (0 );
153
+ for (auto *B : TargetSec.blocks ())
154
+ if (B->getAddress () < SecAddress)
155
+ SecAddress = B->getAddress ();
156
+
157
+ JITTargetAddress SecDelta = TargetSym.getAddress () - SecAddress;
158
+ OS << formatv (" {0:x16}" , TargetSym.getAddress ()) << " (section "
159
+ << TargetSec.getName ();
160
+ if (SecDelta)
161
+ OS << " + " << formatv (" {0:x}" , SecDelta);
162
+ OS << " / block " << formatv (" {0:x16}" , TargetBlock.getAddress ());
163
+ if (TargetSym.getOffset ())
164
+ OS << " + " << formatv (" {0:x}" , TargetSym.getOffset ());
165
+ OS << " )" ;
166
+ }
167
+
168
+ if (E.getAddend () != 0 )
169
+ OS << " + " << E.getAddend ();
144
170
}
145
171
146
172
Section::~Section () {
0 commit comments