]> git.sur5r.net Git - cc65/blobdiff - src/ld65/exports.h
Merge remote-tracking branch 'upstream/master' into a5200
[cc65] / src / ld65 / exports.h
index 281b248058038e1756e7b0e4a9b9b36737d93b7e..2b7c55bed82bc9f9a2778830ca114cdda4dba6e3 100644 (file)
@@ -1,12 +1,12 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                exports.h                                 */
+/*                                 exports.h                                 */
 /*                                                                           */
-/*                   Exports handing for the ld65 linker                    */
+/*                    Exports handing for the ld65 linker                    */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2010, Ullrich von Bassewitz                                      */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
 
 /* 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"
 
 
 
 /*****************************************************************************/
-/*                                          Data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
 /* Import symbol structure */
 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 */
-    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 */
+    Import*             Next;           /* Single linked list */
+    ObjData*            Obj;            /* Object file that imports the name */
+    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 short      Flags;          /* Generic flags */
+    unsigned short      AddrSize;       /* Address size of import */
 };
 
 
@@ -75,17 +77,20 @@ struct Import {
 /* Export symbol structure */
 typedef struct Export Export;
 struct Export {
-    unsigned            Name;                  /* Name */
-    Export*                    Next;           /* Hash table link */
-    unsigned           Flags;          /* Generic flags */
-    ObjData*           Obj;            /* Object file that exports the name */
-    unsigned           ImpCount;       /* How many imports for this symbol? */
-    Import*            ImpList;        /* List of imports for this symbol */
-    ExprNode*                  Expr;           /* Expression (0 if not def'd) */
-    FilePos            Pos;            /* File position of definition */
-    unsigned char      Type;           /* Type of export */
-    unsigned char       AddrSize;       /* Address size of export */
-    unsigned char      ConDes[CD_TYPE_COUNT];  /* Constructor/destructor decls */
+    unsigned            Name;           /* Name */
+    Export*             Next;           /* Hash table link */
+    unsigned            Flags;          /* Generic flags */
+    ObjData*            Obj;            /* Object file that exports the name */
+    unsigned            ImpCount;       /* How many imports for this symbol? */
+    Import*             ImpList;        /* List of imports for this symbol */
+    ExprNode*           Expr;           /* Expression (0 if not def'd) */
+    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 */
 };
 
 
@@ -101,7 +106,7 @@ typedef int (*ExpCheckFunc) (unsigned Name, void* Data);
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -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,6 +141,9 @@ 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 */
 
@@ -201,7 +212,3 @@ void CircularRefError (const Export* E);
 /* End of exports.h */
 
 #endif
-
-
-
-