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

@@ -175,7 +175,7 @@ static IfDesc* AllocIf (const char* Directive, int NeedTerm)
ID->Flags |= ifParentCond;
}
ID->LineInfos = EmptyCollection;
GetFullLineInfo (&ID->LineInfos, 0);
GetFullLineInfo (&ID->LineInfos);
ID->Name = Directive;
/* One more slot allocated */
@@ -198,6 +198,7 @@ static void FreeIf (void)
Done = 1;
} else {
Done = (ID->Flags & ifNeedTerm) != 0;
ReleaseFullLineInfo (&ID->LineInfos);
DoneCollection (&ID->LineInfos);
--IfCount;
}
@@ -229,7 +230,8 @@ void DoConditionals (void)
/* Remember the data for the .ELSE */
if (D) {
GetFullLineInfo (&D->LineInfos, 0);
ReleaseFullLineInfo (&D->LineInfos);
GetFullLineInfo (&D->LineInfos);
D->Name = ".ELSE";
}