Fixed line info issues
git-svn-id: svn://svn.cc65.org/cc65/trunk@763 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -166,8 +166,17 @@ static int CmpLineInfo (void* Data, const void* LI1_, const void* LI2_)
|
|||||||
void MakeLineInfoIndex (void)
|
void MakeLineInfoIndex (void)
|
||||||
/* Sort the line infos and drop all unreferenced ones */
|
/* Sort the line infos and drop all unreferenced ones */
|
||||||
{
|
{
|
||||||
|
unsigned I;
|
||||||
|
|
||||||
/* Sort the collection */
|
/* Sort the collection */
|
||||||
CollSort (&LineInfoColl, CmpLineInfo, 0);
|
CollSort (&LineInfoColl, CmpLineInfo, 0);
|
||||||
|
|
||||||
|
/* Walk over the list and index the line infos. */
|
||||||
|
for (I = 0; I < LineInfoValid; ++I) {
|
||||||
|
/* Get a pointer to this line info */
|
||||||
|
LineInfo* LI = CollAtUnchecked (&LineInfoColl, I);
|
||||||
|
LI->Index = I;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -203,6 +212,9 @@ void WriteLineInfo (void)
|
|||||||
ObjWriteVar (0);
|
ObjWriteVar (0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* End of line infos */
|
||||||
|
ObjEndLineInfos ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -458,8 +458,6 @@ static void WriteOneSeg (Segment* Seg)
|
|||||||
/* Write one segment to the object file */
|
/* Write one segment to the object file */
|
||||||
{
|
{
|
||||||
Fragment* Frag;
|
Fragment* Frag;
|
||||||
Fragment* F;
|
|
||||||
unsigned long Size;
|
|
||||||
unsigned LineInfoIndex;
|
unsigned LineInfoIndex;
|
||||||
|
|
||||||
/* Write the segment name followed by the byte count in this segment */
|
/* Write the segment name followed by the byte count in this segment */
|
||||||
@@ -478,26 +476,9 @@ static void WriteOneSeg (Segment* Seg)
|
|||||||
switch (Frag->Type) {
|
switch (Frag->Type) {
|
||||||
|
|
||||||
case FRAG_LITERAL:
|
case FRAG_LITERAL:
|
||||||
/* To make the object file somewhat smaller, write all literal
|
|
||||||
* data of this and the following fragments preceeded by the
|
|
||||||
* length.
|
|
||||||
*/
|
|
||||||
F = Frag;
|
|
||||||
Size = 0;
|
|
||||||
while (F && F->Type == FRAG_LITERAL) {
|
|
||||||
Size += F->Len;
|
|
||||||
F = F->Next;
|
|
||||||
}
|
|
||||||
ObjWrite8 (FRAG_LITERAL);
|
ObjWrite8 (FRAG_LITERAL);
|
||||||
ObjWriteVar (Size);
|
ObjWriteVar (Frag->Len);
|
||||||
|
ObjWriteData (Frag->V.Data, Frag->Len);
|
||||||
/* Now write the literal data */
|
|
||||||
F = Frag;
|
|
||||||
while (F && F->Type == FRAG_LITERAL) {
|
|
||||||
ObjWriteData (F->V.Data, F->Len);
|
|
||||||
Frag = F;
|
|
||||||
F = F->Next;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FRAG_EXPR:
|
case FRAG_EXPR:
|
||||||
|
|||||||
Reference in New Issue
Block a user