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 */
};
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);
# 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.
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 */
# 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 */