unsigned GetSymExportId (const SymEntry* S)
/* Return the export id for the given symbol */
{
- PRECONDITION (S != 0 && (S->Flags & SF_IMPORT) && S->ExportId != ~0U);
+ PRECONDITION (S != 0 && (S->Flags & SF_EXPORT) && S->ExportId != ~0U);
return S->ExportId;
}
#define SF_DEFINED 0x4000 /* Defined */
#define SF_REFERENCED 0x8000 /* Referenced */
+/* Combined values */
+#define SF_REFIMP (SF_REFERENCED|SF_IMPORT) /* A ref'd import */
+
/* Arguments for SymFind... */
#define SYM_FIND_EXISTING 0
#define SYM_ALLOC_NEW 1
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/* Combined symbol entry flags used within this module */
#define SF_UNDEFMASK (SF_REFERENCED | SF_DEFINED | SF_IMPORT)
-#define SF_UNDEFVAL (SF_REFERENCED)
-#define SF_DBGINFOMASK (SF_UNUSED | SF_DEFINED | SF_IMPORT)
-#define SF_DBGINFOVAL (SF_DEFINED)
+#define SF_UNDEFVAL (SF_REFERENCED)
/* Symbol tables */
SymTable* CurrentScope = 0; /* Pointer to current symbol table */
+static int IsDbgSym (const SymEntry* S)
+/* Return true if this is a debug symbol */
+{
+ if ((S->Flags & (SF_DEFINED | SF_UNUSED)) == SF_DEFINED) {
+ /* Defined symbols are debug symbols if they aren't sizes */
+ return !IsSizeOfSymbol (S);
+ } else {
+ /* Others are debug symbols if they're referenced imports */
+ return ((S->Flags & SF_REFIMP) == SF_REFIMP);
+ }
+}
+
+
+
static unsigned ScopeTableSize (unsigned Level)
/* Get the size of a table for the given lexical level */
{
Count = 0;
S = SymList;
while (S) {
- if ((S->Flags & SF_DBGINFOMASK) == SF_DBGINFOVAL &&
- !IsSizeOfSymbol (S)) {
+ if (IsDbgSym (S)) {
S->DebugSymId = Count++;
}
S = S->List;
*/
S = SymList;
while (S) {
- if ((S->Flags & SF_DBGINFOMASK) == SF_DBGINFOVAL &&
- !IsSizeOfSymbol (S)) {
+ if (IsDbgSym (S)) {
/* Get the expression bits and the value */
long ConstVal;