int CodeEntriesAreEqual (const CodeEntry* E1, const CodeEntry* E2)
/* Check if both code entries are equal */
{
- return E1->OPC == E2->OPC && E1->AM == E2->AM && strcmp (E1->Arg, E2->Arg) == 0;
+ return (E1->OPC == E2->OPC && E1->AM == E2->AM && strcmp (E1->Arg, E2->Arg) == 0);
}
+void CE_SetArg (CodeEntry* E, const char* Arg)
+/* Replace the argument by the new one. */
+{
+ /* Free the old argument */
+ FreeArg (E->Arg);
+
+ /* Assign the new one */
+ E->Arg = GetArgCopy (Arg);
+}
+
+
+
void CE_SetNumArg (CodeEntry* E, long Num)
/* Set a new numeric argument for the given code entry that must already
* have a numeric argument.
Internal ("Invalid instruction size in CE_SetNumArg");
}
- /* Free the old argument */
- FreeArg (E->Arg);
-
- /* Assign the new one */
- E->Arg = GetArgCopy (Buf);
+ /* Replace the argument by the new one */
+ CE_SetArg (E, Buf);
/* Use the new numerical value */
E->Num = Num;
#else
# define CE_HasMark(E) (((E)->Flags & CEF_USERMARK) != 0)
#endif
-
+
#if defined(HAVE_INLINE)
INLINE void CE_SetMark (CodeEntry* E)
/* Set the CEF_USERMARK flag for the given entry */
# define CE_ResetMark(E) ((E)->Flags &= ~CEF_USERMARK)
#endif
+void CE_SetArg (CodeEntry* E, const char* Arg);
+/* Replace the argument by the new one. */
+
void CE_SetNumArg (CodeEntry* E, long Num);
/* Set a new numeric argument for the given code entry that must already
* have a numeric argument.
/* The insn at E jumps to this label */
E->JumpTo = L;
+ /* Replace the code entry argument with the name of the new label */
+ CE_SetArg (E, L->Name);
+
/* Remember that in the label */
CollAppend (&L->JumpFrom, E);
}