S->Id = Id;
S->Obj = Obj;
S->Size = 0;
+ S->LabelId = ~0U;
S->Spans = EmptyCollection;
/* Return the new entry */
if (SCOPE_HAS_SIZE (S->Flags)) {
S->Size = ReadVar (F);
}
+ if (SCOPE_HAS_LABEL (S->Flags)) {
+ S->LabelId = ReadVar (F);
+ }
/* Read the segment ranges for this scope */
ReadSpans (&S->Spans, F, Obj);
if (S->Id != S->ParentId) {
fprintf (F, ",parent=%u", O->ScopeBaseId + S->ParentId);
}
-
+ /* Print the label id if the scope is labeled */
+ if (SCOPE_HAS_LABEL (S->Flags)) {
+ fprintf (F, ",sym=%u", O->SymBaseId + S->LabelId);
+ }
+
/* Terminate the output line */
fputc ('\n', F);
}
typedef struct Scope Scope;
struct Scope {
unsigned Id; /* Id of scope */
- ObjData* Obj; /* Object file that exports the name */
+ ObjData* Obj; /* Object file that contains the scope */
unsigned ParentId; /* Id of parent scope */
- unsigned LexicalLevel; /* Lexical level */
+ unsigned LabelId; /* Id of the scope label if any */
+ unsigned LexicalLevel; /* Lexical level */
unsigned Flags;
unsigned Type; /* Type of scope */
unsigned Name; /* Name of scope */