L->Next = 0;
L->Name = xstrdup (Name);
L->Hash = Hash;
- L->Flags = 0;
L->Owner = 0;
InitCollection (&L->JumpFrom);
-void AddLabelRef (CodeLabel* L, struct CodeEntry* E)
+void CL_AddRef (CodeLabel* L, struct CodeEntry* E)
/* Let the CodeEntry E reference the label L */
{
/* The insn at E jumps to this label */
-unsigned RemoveLabelRef (CodeLabel* L, const struct CodeEntry* E)
-/* Remove a reference to this label, return the number of remaining references */
-{
- /* Delete the item */
- CollDeleteItem (&L->JumpFrom, E);
-
- /* Return the number of remaining references */
- return CollCount (&L->JumpFrom);
-}
-
-
-
-void MoveLabelRefs (CodeLabel* OldLabel, CodeLabel* NewLabel)
+void CL_MoveRefs (CodeLabel* OldLabel, CodeLabel* NewLabel)
/* Move all references to OldLabel to point to NewLabel. OldLabel will have no
* more references on return.
*/
{
/* Walk through all instructions referencing the old label */
- unsigned Count = CollCount (&OldLabel->JumpFrom);
+ unsigned Count = CL_GetRefCount (OldLabel);
while (Count--) {
/* Get the instruction that references the old label */
- CodeEntry* E = CollAt (&OldLabel->JumpFrom, Count);
+ CodeEntry* E = CL_GetRef (OldLabel, Count);
/* Change the reference to the new label */
CHECK (E->JumpTo == OldLabel);
- AddLabelRef (NewLabel, E);
+ CL_AddRef (NewLabel, E);
}
-void OutputCodeLabel (const CodeLabel* L, FILE* F)
+void CL_Output (const CodeLabel* L, FILE* F)
/* Output the code label to a file */
{
fprintf (F, "%s:", L->Name);
+ if (strlen (L->Name) > 6) {
+ /* Label is too long, add a linefeed */
+ fputc ('\n', F);
+ }
}
+