/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
CodeMark GetCodePos (void)
/* Get a marker pointing to the current output position */
{
- return GetCodeEntryCount (CS->Code);
+ return CS_GetEntryCount (CS->Code);
}
void RemoveCode (CodeMark M)
/* Remove all code after the given code marker */
{
- DelCodeSegAfter (CS->Code, M);
+ CS_DelCodeAfter (CS->Code, M);
+}
+
+
+
+void MoveCode (CodeMark Start, CodeMark End, CodeMark Target)
+/* Move the code between Start (inclusive) and End (exclusive) to
+ * (before) Target.
+ */
+{
+ CS_MoveEntries (CS->Code, Start, End - Start, Target);
}
SymEntry* Entry;
/* Output the global data segment */
- CHECK (GetCodeEntryCount (CS->Code) == 0);
+ CHECK (CS_GetEntryCount (CS->Code) == 0);
OutputSegments (CS, F);
/* Output all global or referenced functions */
Entry = SymTab->SymHead;
while (Entry) {
if (IsTypeFunc (Entry->Type) &&
- (Entry->Flags & SC_DEF) != 0 &&
- (Entry->Flags & (SC_REF | SC_EXTERN)) != 0) {
- /* Function which is defined and referenced or extern */
- MergeCodeLabels (Entry->V.F.Seg->Code);
- RunOpt (Entry->V.F.Seg->Code);
- OutputSegments (Entry->V.F.Seg, F);
- }
- Entry = Entry->NextSym;
+ SymIsDef (Entry) &&
+ (Entry->Flags & (SC_REF | SC_EXTERN)) != 0) {
+ /* Function which is defined and referenced or extern */
+ CS_MergeLabels (Entry->V.F.Seg->Code);
+ RunOpt (Entry->V.F.Seg->Code);
+ OutputSegments (Entry->V.F.Seg, F);
+ }
+ Entry = Entry->NextSym;
}
}