case EXPR_SYMBOL:
if (SymIsImport (Expr->V.Sym)) {
ObjWrite8 (EXPR_SYMBOL);
- ObjWriteVar (GetSymIndex (Expr->V.Sym));
+ ObjWriteVar (GetSymImportId (Expr->V.Sym));
} else {
WriteExpr (GetSymExpr (Expr->V.Sym));
}
/* */
/* */
/* */
-/* (C) 1998-2008 Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2010, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
S->GuessedUse[I] = 0;
}
S->Flags = Flags;
+ S->ImportId = ~0U;
S->Expr = 0;
S->ExprRefs = AUTO_COLLECTION_INITIALIZER;
S->ExportSize = ADDR_SIZE_DEFAULT;
-unsigned GetSymIndex (const SymEntry* S)
-/* Return the symbol index for the given symbol */
+unsigned GetSymImportId (const SymEntry* S)
+/* Return the import id for the given symbol */
{
- PRECONDITION (S != 0 && (S->Flags & SF_INDEXED) != 0);
- return S->Index;
+ PRECONDITION (S != 0 && (S->Flags & SF_IMPORT) && S->ImportId != ~0U);
+ return S->ImportId;
}
/* */
/* */
/* */
-/* (C) 1998-2008 Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2010, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
* addressing
*/
unsigned Flags; /* Symbol flags */
- unsigned Index; /* Index of import/export entries */
+ unsigned ImportId; /* Id if imported symbol */
struct ExprNode* Expr; /* Symbol expression */
Collection ExprRefs; /* Expressions using this symbol */
unsigned char ExportSize; /* Export address size */
* in case the symbol is undefined or not constant.
*/
-unsigned GetSymIndex (const SymEntry* Sym);
-/* Return the symbol index for the given symbol */
+unsigned GetSymImportId (const SymEntry* Sym);
+/* Return the import id for the given symbol */
#if defined(HAVE_INLINE)
INLINE const FilePos* GetSymPos (const SymEntry* S)
"Symbol `%m%p' is imported but never used",
GetSymName (S));
} else {
- /* Give the import an index, count imports */
- S->Index = ImportCount++;
- S->Flags |= SF_INDEXED;
+ /* Give the import an id, count imports */
+ S->ImportId = ImportCount++;
}
}
- /* Assign an index to all exports */
+ /* Count exports */
if (S->Flags & SF_EXPORT) {
- /* Give the export an index, count exports */
- S->Index = ExportCount++;
- S->Flags |= SF_INDEXED;
+ ++ExportCount;
}
/* If the symbol is defined but has an unknown address size,