Clean up symbol management

Stop using that bitfield for everything, including what can be determined otherwise
It also makes it easier to have a sane state, since some bits were (supposedly)
mutually exclusive
This commit is contained in:
ISSOtm
2020-01-22 15:05:07 +01:00
parent e3ef194b4f
commit ab9307ac61
10 changed files with 162 additions and 169 deletions

View File

@@ -143,7 +143,9 @@ void rpn_Number(struct Expression *expr, uint32_t i)
void rpn_Symbol(struct Expression *expr, char *tzSym)
{
if (!sym_isConstant(tzSym)) {
struct sSymbol *sym = sym_FindSymbol(tzSym);
if (!sym || !sym_IsConstant(sym)) {
rpn_Init(expr);
sym_Ref(tzSym);
expr->isReloc = 1;
@@ -176,13 +178,15 @@ void rpn_BankSelf(struct Expression *expr)
void rpn_BankSymbol(struct Expression *expr, char *tzSym)
{
struct sSymbol const *sym = sym_FindSymbol(tzSym);
/* The @ symbol is treated differently. */
if (sym_FindSymbol(tzSym) == pPCSymbol) {
if (sym == pPCSymbol) {
rpn_BankSelf(expr);
return;
}
if (sym_isConstant(tzSym)) {
if (sym && sym_IsConstant(sym)) {
yyerror("BANK argument must be a relocatable identifier");
} else {
rpn_Init(expr);