Add reference counting to line infos. This allows better tracking of the ones

that are actually used.


git-svn-id: svn://svn.cc65.org/cc65/trunk@5212 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-18 14:36:38 +00:00
parent bd233ac916
commit 2f9e7d2ca0
11 changed files with 126 additions and 72 deletions

View File

@@ -81,12 +81,23 @@ void NewAsmLine (void);
* changed, end the old and start the new line as necessary.
*/
void GetFullLineInfo (Collection* LineInfos, int ForceRef);
LineInfo* GetAsmLineInfo (void);
/* Return the line info for the current assembler file. The function will
* bump the reference counter before returning the line info.
*/
void ReleaseLineInfo (LineInfo* LI);
/* Decrease the reference count for a line info */
void GetFullLineInfo (Collection* LineInfos);
/* Return full line infos, that is line infos for currently active Slots. The
* function will clear LineInfos before usage. If ForceRef is not zero, a
* forced reference will be added to all line infos, with the consequence that
* they won't get deleted, even if there is no code or data generated for these
* lines.
* infos will be added to the given collection, existing entries will be left
* intact. The reference count of all added entries will be increased.
*/
void ReleaseFullLineInfo (Collection* LineInfos);
/* Decrease the reference count for a collection full of LineInfos, then clear
* the collection.
*/
const FilePos* GetSourcePos (const LineInfo* LI);