X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fld65%2Fexports.h;h=97315686595aaf47ab35821a1b2fcddd09a0dfa0;hb=7aefd9b4e7b67908b7b3c38b6003c7f1a8d3ee2d;hp=170f80978fa7b57cffdc9512f520f90d68733432;hpb=da792b3fd0955983f0a663f002353b0636831837;p=cc65 diff --git a/src/ld65/exports.h b/src/ld65/exports.h index 170f80978..973156865 100644 --- a/src/ld65/exports.h +++ b/src/ld65/exports.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2010, Ullrich von Bassewitz */ +/* (C) 1998-2011, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -42,11 +42,12 @@ /* common */ #include "cddefs.h" +#include "coll.h" #include "exprdefs.h" -#include "filepos.h" /* ld65 */ #include "config.h" +#include "lineinfo.h" #include "memarea.h" #include "objdata.h" @@ -63,11 +64,12 @@ typedef struct Import Import; struct Import { Import* Next; /* Single linked list */ ObjData* Obj; /* Object file that imports the name */ - FilePos Pos; /* File position of reference */ + Collection DefLines; /* Line infos of definition */ + Collection RefLines; /* Line infos of reference */ struct Export* Exp; /* Matching export for this import */ unsigned Name; /* Name if not in table */ - unsigned char Flags; /* Generic flags */ - unsigned char AddrSize; /* Address size of import */ + unsigned short Flags; /* Generic flags */ + unsigned short AddrSize; /* Address size of import */ }; @@ -81,10 +83,13 @@ struct Export { ObjData* Obj; /* Object file that exports the name */ unsigned ImpCount; /* How many imports for this symbol? */ Import* ImpList; /* List of imports for this symbol */ - FilePos Pos; /* File position of definition */ ExprNode* Expr; /* Expression (0 if not def'd) */ - unsigned char Type; /* Type of export */ - unsigned char AddrSize; /* Address size of export */ + unsigned Size; /* Size of the symbol if any */ + Collection DefLines; /* Line infos of definition */ + Collection RefLines; /* Line infos of reference */ + unsigned DbgSymId; /* Id of debug symbol for this export */ + unsigned short Type; /* Type of export */ + unsigned short AddrSize; /* Address size of export */ unsigned char ConDes[CD_TYPE_COUNT]; /* Constructor/destructor decls */ }; @@ -121,6 +126,9 @@ Import* GenImport (unsigned Name, unsigned char AddrSize); Import* InsertImport (Import* I); /* Insert an import into the table, return I */ +const LineInfo* GetImportPos (const Import* I); +/* Return the basic line info of an import */ + void FreeExport (Export* E); /* Free an export. NOTE: This won't remove the export from the exports table, * so it may only be called for unused exports (exports from modules that @@ -133,9 +141,15 @@ Export* ReadExport (FILE* F, ObjData* Obj); void InsertExport (Export* E); /* Insert an exported identifier and check if it's already in the list */ +const LineInfo* GetExportPos (const Export* E); +/* Return the basic line info of an export */ + Export* CreateConstExport (unsigned Name, long Value); /* Create an export for a literal date */ +Export* CreateExprExport (unsigned Name, ExprNode* Expr, unsigned char AddrSize); +/* Create an export for an expression */ + Export* CreateMemoryExport (unsigned Name, MemoryArea* Mem, unsigned long Offs); /* Create an relative export for a memory area offset */