/*****************************************************************************/
/* */
-/* symentry.h */
+/* symentry.h */
/* */
-/* Symbol table entry forward for the ca65 macroassembler */
+/* Symbol table entry forward for the ca65 macroassembler */
/* */
/* */
/* */
-/* (C) 1998-2010, Ullrich von Bassewitz */
+/* (C) 1998-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
+/* Forwards */
+struct HLLDbgSym;
+
/* Bits for the Flags value in SymEntry */
#define SF_NONE 0x0000 /* Empty flag set */
-#define SF_USER 0x0001 /* User bit */
-#define SF_UNUSED 0x0002 /* Unused entry */
-#define SF_EXPORT 0x0004 /* Export this symbol */
-#define SF_IMPORT 0x0008 /* Import this symbol */
-#define SF_GLOBAL 0x0010 /* Global symbol */
+#define SF_USER 0x0001 /* User bit */
+#define SF_UNUSED 0x0002 /* Unused entry */
+#define SF_EXPORT 0x0004 /* Export this symbol */
+#define SF_IMPORT 0x0008 /* Import this symbol */
+#define SF_GLOBAL 0x0010 /* Global symbol */
#define SF_LOCAL 0x0020 /* Cheap local symbol */
-#define SF_LABEL 0x0080 /* Used as a label */
-#define SF_VAR 0x0100 /* Variable symbol */
-#define SF_FORCED 0x0400 /* Forced import, SF_IMPORT also set */
-#define SF_MULTDEF 0x2000 /* Multiply defined symbol */
-#define SF_DEFINED 0x4000 /* Defined */
-#define SF_REFERENCED 0x8000 /* Referenced */
+#define SF_LABEL 0x0040 /* Used as a label */
+#define SF_VAR 0x0080 /* Variable symbol */
+#define SF_FORCED 0x0100 /* Forced import, SF_IMPORT also set */
+#define SF_FIXED 0x0200 /* May not be trampoline */
+#define SF_MULTDEF 0x1000 /* Multiply defined symbol */
+#define SF_DEFINED 0x2000 /* Defined */
+#define SF_REFERENCED 0x4000 /* Referenced */
-/* Arguments for SymFind... */
-#define SYM_FIND_EXISTING 0
-#define SYM_ALLOC_NEW 1
+/* Combined values */
+#define SF_REFIMP (SF_REFERENCED|SF_IMPORT) /* A ref'd import */
/* Structure of a symbol table entry */
typedef struct SymEntry SymEntry;
struct SymEntry {
- SymEntry* Left; /* Lexically smaller entry */
- SymEntry* Right; /* Lexically larger entry */
- SymEntry* List; /* List of all entries */
- SymEntry* Locals; /* Root of subtree for local symbols */
+ SymEntry* Left; /* Lexically smaller entry */
+ SymEntry* Right; /* Lexically larger entry */
+ SymEntry* List; /* List of all entries */
+ SymEntry* Locals; /* Root of subtree for local symbols */
union {
- struct SymTable* Tab; /* Table this symbol is in */
- struct SymEntry* Entry;
+ struct SymTable* Tab; /* Table this symbol is in */
+ struct SymEntry* Entry; /* Parent for cheap locals */
} Sym;
- FilePos Pos; /* File position for this symbol */
+ Collection DefLines; /* Line infos for definition */
+ Collection RefLines; /* Line infos for references */
FilePos* GuessedUse[1]; /* File position where symbol
* address size was guessed, and the
* smallest possible addressing was NOT
* used. Currently only for zero page
* addressing
*/
- unsigned Flags; /* Symbol flags */
+ struct HLLDbgSym* HLLSym; /* Symbol from high level language */
+ unsigned Flags; /* Symbol flags */
unsigned DebugSymId; /* Debug symbol id */
- unsigned ImportId; /* Id of import if this is one */
- struct ExprNode* Expr; /* Symbol expression */
+ unsigned ImportId; /* Id of import if this is one */
+ unsigned ExportId; /* Id of export if this is one */
+ struct ExprNode* Expr; /* Symbol expression */
Collection ExprRefs; /* Expressions using this symbol */
unsigned char ExportSize; /* Export address size */
unsigned char AddrSize; /* Address size of label */
- unsigned char ConDesPrio[CD_TYPE_COUNT]; /* ConDes priorities... */
- /* ...actually value+1 (used as flag) */
- unsigned Name; /* Name index in global string pool */
+ unsigned char ConDesPrio[CD_TYPE_COUNT]; /* ConDes priorities... */
+ /* ...actually value+1 (used as flag) */
+ unsigned Name; /* Name index in global string pool */
};
/* List of all symbol table entries */
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
unsigned GetSymImportId (const SymEntry* Sym);
/* Return the import id for the given symbol */
+unsigned GetSymExportId (const SymEntry* Sym);
+/* Return the export id for the given symbol */
+
unsigned GetSymInfoFlags (const SymEntry* Sym, long* ConstVal);
/* Return a set of flags used when writing symbol information into a file.
* If the SYM_CONST bit is set, ConstVal will contain the constant value
* See common/symdefs.h for more information.
*/
-#if defined(HAVE_INLINE)
-INLINE const FilePos* GetSymPos (const SymEntry* S)
-/* Return the position of first occurence in the source for the given symbol */
-{
- return &S->Pos;
-}
-#else
-# define GetSymPos(S) (&(S)->Pos)
-#endif
-
/* End of symentry.h */
#endif
-
-
-
-