]> git.sur5r.net Git - cc65/blobdiff - src/cc65/codeseg.h
Use xsprintf
[cc65] / src / cc65 / codeseg.h
index 59353e8894bcacfa970b8074a6f558a87be27910..fc61ab25eb476790ef4d25cad27cf587c9b4e004 100644 (file)
@@ -80,7 +80,7 @@ struct CodeSeg {
     Collection     Entries;                    /* List of code entries */
     Collection     Labels;                     /* Labels for next insn */
     CodeLabel*             LabelHash [CS_LABEL_HASH_SIZE]; /* Label hash table */
-    unsigned char   ExitRegs;                  /* Register use on exit */
+    unsigned short  ExitRegs;                  /* Register use on exit */
 };
 
 
@@ -97,7 +97,10 @@ CodeSeg* NewCodeSeg (const char* SegName, SymEntry* Func);
 void CS_AddEntry (CodeSeg* S, struct CodeEntry* E);
 /* Add an entry to the given code segment */
 
-void CS_AddLine (CodeSeg* S, LineInfo* LI, const char* Format, va_list ap) attribute ((format(printf,3,0)));
+void CS_AddVLine (CodeSeg* S, LineInfo* LI, const char* Format, va_list ap) attribute ((format(printf,3,0)));
+/* Add a line to the given code segment */
+
+void CS_AddLine (CodeSeg* S, LineInfo* LI, const char* Format, ...) attribute ((format(printf,3,4)));
 /* Add a line to the given code segment */
 
 void CS_InsertEntry (CodeSeg* S, struct CodeEntry* E, unsigned Index);
@@ -149,6 +152,11 @@ INLINE struct CodeEntry* CS_GetEntry (CodeSeg* S, unsigned Index)
 #  define CS_GetEntry(S, Index)        CollAt(&(S)->Entries, (Index))
 #endif
 
+struct CodeEntry* CS_GetPrevEntry (CodeSeg* S, unsigned Index);
+/* Get the code entry preceeding the one with the index Index. If there is no
+ * preceeding code entry, return NULL.
+ */
+
 struct CodeEntry* CS_GetNextEntry (CodeSeg* S, unsigned Index);
 /* Get the code entry following the one with the index Index. If there is no
  * following code entry, return NULL.
@@ -163,6 +171,12 @@ int CS_GetEntries (CodeSeg* S, struct CodeEntry** List,
 unsigned CS_GetEntryIndex (CodeSeg* S, struct CodeEntry* E);
 /* Return the index of a code entry */
 
+int CS_RangeHasLabel (CodeSeg* S, unsigned Start, unsigned Count);
+/* Return true if any of the code entries in the given range has a label
+ * attached. If the code segment does not span the given range, check the
+ * possible span instead.
+ */
+
 CodeLabel* CS_AddLabel (CodeSeg* S, const char* Name);
 /* Add a code label for the next instruction to follow */
 
@@ -215,6 +229,12 @@ INLINE unsigned CS_GetEntryCount (const CodeSeg* S)
 #  define CS_GetEntryCount(S)  CollCount (&(S)->Entries)
 #endif
 
+void CS_FreeRegInfo (CodeSeg* S);
+/* Free register infos for all instructions */
+
+void CS_GenRegInfo (CodeSeg* S);
+/* Generate register infos for all instructions */
+
 
 
 /* End of codeseg.h */