]> git.sur5r.net Git - cc65/blobdiff - src/cc65/codeseg.c
Make the -O and --codesize options stackable.
[cc65] / src / cc65 / codeseg.c
index 1126e08ee1564de18f3928cb1e7b15fc1f4e559c..c27f44b3d9b9898cd35e2460fd7344563c08238f 100644 (file)
 #include "asmlabel.h"
 #include "codeent.h"
 #include "codeinfo.h"
+#include "codeseg.h"
 #include "datatype.h"
 #include "error.h"
+#include "global.h"
 #include "ident.h"
 #include "symentry.h"
-#include "codeseg.h"
 
 
 
@@ -471,6 +472,10 @@ CodeSeg* NewCodeSeg (const char* SegName, SymEntry* Func)
        S->ExitRegs = REG_NONE;
     }
 
+    /* Copy the global optimization settings */
+    S->Optimize       = (unsigned char) IS_Get (&Optimize);
+    S->CodeSizeFactor = (unsigned) IS_Get (&CodeSizeFactor);
+
     /* Return the new struct */
     return S;
 }