1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-28 10:55:43 +00:00
git-svn-id: svn://svn.cc65.org/cc65/trunk@760 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-05-26 10:04:15 +00:00
parent c80bb24eee
commit 916a0879d5
7 changed files with 11 additions and 67 deletions

View File

@ -239,9 +239,6 @@ int CodeEntriesAreEqual (const CodeEntry* E1, const CodeEntry* E2)
void AttachCodeLabel (CodeEntry* E, CodeLabel* L)
/* Attach the label to the entry */
{
/* Mark the label as defined */
L->Flags |= LF_DEF;
/* Add it to the entries label list */
CollAppend (&E->Labels, L);

View File

@ -59,7 +59,6 @@ CodeLabel* NewCodeLabel (const char* Name, unsigned Hash)
L->Next = 0;
L->Name = xstrdup (Name);
L->Hash = Hash;
L->Flags = 0;
L->Owner = 0;
InitCollection (&L->JumpFrom);

View File

@ -61,16 +61,12 @@ struct CodeEntry;
/* Label flags, bitmapped */
#define LF_DEF 0x0001U /* Label was defined */
/* Label structure */
typedef struct CodeLabel CodeLabel;
struct CodeLabel {
CodeLabel* Next; /* Next in hash list */
char* Name; /* Label name */
unsigned short Hash; /* Hash over the name */
unsigned short Flags; /* Flag flags */
unsigned Hash; /* Hash over the name */
struct CodeEntry* Owner; /* Owner entry */
Collection JumpFrom; /* Entries that jump here */
};

View File

@ -68,7 +68,6 @@ static void MoveLabelsToPool (CodeSeg* S, CodeEntry* E)
unsigned LabelCount = GetCodeLabelCount (E);
while (LabelCount--) {
CodeLabel* L = GetCodeLabel (E, LabelCount);
L->Flags &= ~LF_DEF;
L->Owner = 0;
CollAppend (&S->Labels, L);
}

View File

@ -197,7 +197,7 @@ unsigned GetInsnSize (opc_t OPC, am_t AM)
case AM_ZPX_IND: return 2;
case AM_ZP_INDY: return 2;
case AM_ZP_IND: return 2;
default:
default:
Internal ("Invalid addressing mode");
return 0;
}
@ -234,7 +234,7 @@ opc_t GetInverseBranch (opc_t OPC)
case OPC_BMI: return OPC_BPL;
case OPC_BNE: return OPC_BEQ;
case OPC_BPL: return OPC_BMI;
case OPC_BVC: return OPC_BVS;
case OPC_BVC: return OPC_BVS;
case OPC_BVS: return OPC_BVC;
case OPC_JCC: return OPC_JCS;
case OPC_JCS: return OPC_JCC;
@ -244,7 +244,7 @@ opc_t GetInverseBranch (opc_t OPC)
case OPC_JPL: return OPC_JMI;
case OPC_JVC: return OPC_JVS;
case OPC_JVS: return OPC_JVC;
default:
default:
Internal ("GetInverseBranch: Invalid opcode: %d", OPC);
return 0;
}
@ -276,8 +276,8 @@ opc_t MakeShortBranch (opc_t OPC)
case OPC_JVS: return OPC_BVS;
case OPC_BRA:
case OPC_JMP: return (CPU == CPU_65C02)? OPC_BRA : OPC_JMP;
default:
Internal ("GetShortBranch: Invalid opcode: %d", OPC);
default:
Internal ("MakeShortBranch: Invalid opcode: %d", OPC);
return 0;
}
}
@ -308,8 +308,8 @@ opc_t MakeLongBranch (opc_t OPC)
case OPC_JVS: return OPC_JVS;
case OPC_BRA:
case OPC_JMP: return OPC_JMP;
default:
Internal ("GetShortBranch: Invalid opcode: %d", OPC);
default:
Internal ("MakeLongBranch: Invalid opcode: %d", OPC);
return 0;
}
}
@ -336,7 +336,7 @@ bc_t GetBranchCond (opc_t OPC)
case OPC_JPL: return BC_PL;
case OPC_JVC: return BC_VC;
case OPC_JVS: return BC_VS;
default:
default:
Internal ("GetBranchCond: Invalid opcode: %d", OPC);
return 0;
}
@ -356,7 +356,7 @@ bc_t GetInverseCond (bc_t BC)
case BC_PL: return BC_MI;
case BC_VC: return BC_VS;
case BC_VS: return BC_VC;
default:
default:
Internal ("GetInverseCond: Invalid condition: %d", BC);
return 0;
}
@ -364,43 +364,3 @@ bc_t GetInverseCond (bc_t BC)
opc_t GetLongBranch (bc_t BC)
/* Return a long branch for the given branch condition */
{
switch (BC) {
case BC_CC: return OPC_JCC;
case BC_CS: return OPC_JCS;
case BC_EQ: return OPC_JEQ;
case BC_MI: return OPC_JMI;
case BC_NE: return OPC_JNE;
case BC_PL: return OPC_JPL;
case BC_VC: return OPC_JVC;
case BC_VS: return OPC_JVS;
default:
Internal ("GetLongBranch: Invalid condition: %d", BC);
return 0;
}
}
opc_t GetShortBranch (bc_t BC)
/* Return a short branch for the given branch condition */
{
switch (BC) {
case BC_CC: return OPC_BCC;
case BC_CS: return OPC_BCS;
case BC_EQ: return OPC_BEQ;
case BC_MI: return OPC_BMI;
case BC_NE: return OPC_BNE;
case BC_PL: return OPC_BPL;
case BC_VC: return OPC_BVC;
case BC_VS: return OPC_BVS;
default:
Internal ("GetShortBranch: Invalid condition: %d", BC);
return 0;
}
}

View File

@ -151,7 +151,6 @@ typedef enum {
BC_MI,
BC_NE,
BC_PL,
BC_SR,
BC_VC,
BC_VS
} bc_t;
@ -244,12 +243,6 @@ bc_t GetBranchCond (opc_t OPC);
bc_t GetInverseCond (bc_t BC);
/* Return the inverse condition of the given one */
opc_t GetLongBranch (bc_t BC);
/* Return a long branch for the given branch condition */
opc_t GetShortBranch (bc_t BC);
/* Return a short branch for the given branch condition */
/* End of opcodes.h */

View File

@ -625,7 +625,7 @@ static void ForStatement (void)
/* Label for the test expressions */
g_defcodelabel (TestLabel);
/* Parse the text expression */
/* Parse the test expression */
if (CurTok.Tok != TOK_SEMI) {
boolexpr (&lval2);
g_truejump (CF_NONE, lstat);