mirror of
https://github.com/cc65/cc65.git
synced 2024-11-19 06:31:31 +00:00
Rename symbol index => import id because that's what it really is.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4809 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
e55b19fa8b
commit
c921c409e8
@ -1769,7 +1769,7 @@ void WriteExpr (ExprNode* Expr)
|
|||||||
case EXPR_SYMBOL:
|
case EXPR_SYMBOL:
|
||||||
if (SymIsImport (Expr->V.Sym)) {
|
if (SymIsImport (Expr->V.Sym)) {
|
||||||
ObjWrite8 (EXPR_SYMBOL);
|
ObjWrite8 (EXPR_SYMBOL);
|
||||||
ObjWriteVar (GetSymIndex (Expr->V.Sym));
|
ObjWriteVar (GetSymImportId (Expr->V.Sym));
|
||||||
} else {
|
} else {
|
||||||
WriteExpr (GetSymExpr (Expr->V.Sym));
|
WriteExpr (GetSymExpr (Expr->V.Sym));
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998-2008 Ullrich von Bassewitz */
|
/* (C) 1998-2010, Ullrich von Bassewitz */
|
||||||
/* Roemerstrasse 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* This software is provided 'as-is', without any expressed or implied */
|
/* This software is provided 'as-is', without any expressed or implied */
|
||||||
@ -90,6 +90,7 @@ SymEntry* NewSymEntry (const StrBuf* Name, unsigned Flags)
|
|||||||
S->GuessedUse[I] = 0;
|
S->GuessedUse[I] = 0;
|
||||||
}
|
}
|
||||||
S->Flags = Flags;
|
S->Flags = Flags;
|
||||||
|
S->ImportId = ~0U;
|
||||||
S->Expr = 0;
|
S->Expr = 0;
|
||||||
S->ExprRefs = AUTO_COLLECTION_INITIALIZER;
|
S->ExprRefs = AUTO_COLLECTION_INITIALIZER;
|
||||||
S->ExportSize = ADDR_SIZE_DEFAULT;
|
S->ExportSize = ADDR_SIZE_DEFAULT;
|
||||||
@ -662,11 +663,11 @@ long GetSymVal (SymEntry* S)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
unsigned GetSymIndex (const SymEntry* S)
|
unsigned GetSymImportId (const SymEntry* S)
|
||||||
/* Return the symbol index for the given symbol */
|
/* Return the import id for the given symbol */
|
||||||
{
|
{
|
||||||
PRECONDITION (S != 0 && (S->Flags & SF_INDEXED) != 0);
|
PRECONDITION (S != 0 && (S->Flags & SF_IMPORT) && S->ImportId != ~0U);
|
||||||
return S->Index;
|
return S->ImportId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 1998-2008 Ullrich von Bassewitz */
|
/* (C) 1998-2010, Ullrich von Bassewitz */
|
||||||
/* Roemerstrasse 52 */
|
/* Roemerstrasse 52 */
|
||||||
/* D-70794 Filderstadt */
|
/* D-70794 Filderstadt */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* This software is provided 'as-is', without any expressed or implied */
|
/* This software is provided 'as-is', without any expressed or implied */
|
||||||
@ -95,7 +95,7 @@ struct SymEntry {
|
|||||||
* addressing
|
* addressing
|
||||||
*/
|
*/
|
||||||
unsigned Flags; /* Symbol flags */
|
unsigned Flags; /* Symbol flags */
|
||||||
unsigned Index; /* Index of import/export entries */
|
unsigned ImportId; /* Id if imported symbol */
|
||||||
struct ExprNode* Expr; /* Symbol expression */
|
struct ExprNode* Expr; /* Symbol expression */
|
||||||
Collection ExprRefs; /* Expressions using this symbol */
|
Collection ExprRefs; /* Expressions using this symbol */
|
||||||
unsigned char ExportSize; /* Export address size */
|
unsigned char ExportSize; /* Export address size */
|
||||||
@ -335,8 +335,8 @@ long GetSymVal (SymEntry* Sym);
|
|||||||
* in case the symbol is undefined or not constant.
|
* in case the symbol is undefined or not constant.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
unsigned GetSymIndex (const SymEntry* Sym);
|
unsigned GetSymImportId (const SymEntry* Sym);
|
||||||
/* Return the symbol index for the given symbol */
|
/* Return the import id for the given symbol */
|
||||||
|
|
||||||
#if defined(HAVE_INLINE)
|
#if defined(HAVE_INLINE)
|
||||||
INLINE const FilePos* GetSymPos (const SymEntry* S)
|
INLINE const FilePos* GetSymPos (const SymEntry* S)
|
||||||
|
@ -581,17 +581,14 @@ void SymCheck (void)
|
|||||||
"Symbol `%m%p' is imported but never used",
|
"Symbol `%m%p' is imported but never used",
|
||||||
GetSymName (S));
|
GetSymName (S));
|
||||||
} else {
|
} else {
|
||||||
/* Give the import an index, count imports */
|
/* Give the import an id, count imports */
|
||||||
S->Index = ImportCount++;
|
S->ImportId = ImportCount++;
|
||||||
S->Flags |= SF_INDEXED;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assign an index to all exports */
|
/* Count exports */
|
||||||
if (S->Flags & SF_EXPORT) {
|
if (S->Flags & SF_EXPORT) {
|
||||||
/* Give the export an index, count exports */
|
++ExportCount;
|
||||||
S->Index = ExportCount++;
|
|
||||||
S->Flags |= SF_INDEXED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the symbol is defined but has an unknown address size,
|
/* If the symbol is defined but has an unknown address size,
|
||||||
|
Loading…
Reference in New Issue
Block a user