/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
-void AddCodeHint (const char* Hint)
-/* Add an optimizer hint */
+CodeMark GetCodePos (void)
+/* Get a marker pointing to the current output position */
{
- /* ### AddCodeLine ("+%s", Hint); */
+ return CS_GetEntryCount (CS->Code);
}
-CodeMark GetCodePos (void)
-/* Get a marker pointing to the current output position */
+void RemoveCode (CodeMark M)
+/* Remove all code after the given code marker */
{
- return GetCodeSegEntries (CS->Code);
+ CS_DelCodeAfter (CS->Code, M);
}
-void RemoveCode (CodeMark M)
-/* Remove all code after the given code marker */
+void MoveCode (CodeMark Start, CodeMark End, CodeMark Target)
+/* Move the code between Start (inclusive) and End (exclusive) to
+ * (before) Target.
+ */
{
- DelCodeSegAfter (CS->Code, M);
+ CS_MoveEntries (CS->Code, Start, End - Start, Target);
}
SymEntry* Entry;
/* Output the global data segment */
- CHECK (GetCodeSegEntries (CS->Code) == 0);
+ CHECK (!HaveGlobalCode ());
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;
}
}