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

@@ -190,7 +190,7 @@ void Warning (unsigned Level, const char* Format, ...)
Collection LineInfos = STATIC_COLLECTION_INITIALIZER;
/* Get line infos for the current position */
GetFullLineInfo (&LineInfos, 0);
GetFullLineInfo (&LineInfos);
/* Output the message */
va_start (ap, Format);
@@ -198,6 +198,7 @@ void Warning (unsigned Level, const char* Format, ...)
va_end (ap);
/* Free the line info list */
ReleaseFullLineInfo (&LineInfos);
DoneCollection (&LineInfos);
}
}
@@ -265,7 +266,7 @@ void Error (const char* Format, ...)
Collection LineInfos = STATIC_COLLECTION_INITIALIZER;
/* Get line infos for the current position */
GetFullLineInfo (&LineInfos, 0);
GetFullLineInfo (&LineInfos);
/* Output the message */
va_start (ap, Format);
@@ -273,6 +274,7 @@ void Error (const char* Format, ...)
va_end (ap);
/* Free the line info list */
ReleaseFullLineInfo (&LineInfos);
DoneCollection (&LineInfos);
}
@@ -297,7 +299,7 @@ void ErrorSkip (const char* Format, ...)
Collection LineInfos = STATIC_COLLECTION_INITIALIZER;
/* Get line infos for the current position */
GetFullLineInfo (&LineInfos, 0);
GetFullLineInfo (&LineInfos);
/* Output the message */
va_start (ap, Format);
@@ -305,6 +307,7 @@ void ErrorSkip (const char* Format, ...)
va_end (ap);
/* Free the line info list */
ReleaseFullLineInfo (&LineInfos);
DoneCollection (&LineInfos);
/* Skip tokens until we reach the end of the line */