]> git.sur5r.net Git - cc65/blobdiff - src/cc65/asmcode.c
Fixed two compiler warnings.
[cc65] / src / cc65 / asmcode.c
index a09b00dfaa5047e61fc1751a7883759095b52ca5..c70675c011f4f49522b794b18ba9cac6c600c40e 100644 (file)
@@ -38,7 +38,6 @@
 
 /* cc65 */
 #include "asmcode.h"
-#include "codeopt.h"
 #include "codeseg.h"
 #include "dataseg.h"
 #include "segments.h"
@@ -62,6 +61,20 @@ void GetCodePos (CodeMark* M)
 
 
 
+void RemoveCodeRange (const CodeMark* Start, const CodeMark* End)
+/* Remove all code between two code markers */
+{
+    /* Nothing to do if the range is empty */
+    if (Start->Pos == End->Pos) {
+        return;
+    }
+
+    /* Delete the range */
+    CS_DelCodeRange (CS->Code, Start->Pos, End->Pos-1);
+}
+
+
+
 void RemoveCode (const CodeMark* M)
 /* Remove all code after the given code marker */
 {
@@ -110,12 +123,8 @@ void WriteAsmOutput (void)
     SymTab = GetGlobalSymTab ();
     Entry  = SymTab->SymHead;
     while (Entry) {
-               if (IsTypeFunc (Entry->Type)            &&
-                   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);
+               if (SymIsOutputFunc (Entry)) {
+            /* Function which is defined and referenced or extern */
                    OutputSegments (Entry->V.F.Seg);
                }
                Entry = Entry->NextSym;