mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
No need to manually do the Expression destructor's job
This commit is contained in:
@@ -50,8 +50,6 @@ void rpn_StartOfSection(Expression &expr, char const *sectionName);
|
||||
void rpn_SizeOfSectionType(Expression &expr, SectionType type);
|
||||
void rpn_StartOfSectionType(Expression &expr, SectionType type);
|
||||
|
||||
void rpn_Free(Expression &expr);
|
||||
|
||||
void rpn_CheckHRAM(Expression &expr);
|
||||
void rpn_CheckRST(Expression &expr);
|
||||
void rpn_CheckNBit(const Expression &expr, uint8_t n);
|
||||
|
||||
@@ -796,7 +796,6 @@ assert:
|
||||
} else if ($3.val == 0) {
|
||||
failAssert($2);
|
||||
}
|
||||
rpn_Free($3);
|
||||
}
|
||||
| POP_ASSERT assert_type relocexpr COMMA string {
|
||||
if (!$3.isKnown) {
|
||||
@@ -804,7 +803,6 @@ assert:
|
||||
} else if ($3.val == 0) {
|
||||
failAssertMsg($2, $5.string);
|
||||
}
|
||||
rpn_Free($3);
|
||||
}
|
||||
| POP_STATIC_ASSERT assert_type const {
|
||||
if ($3 == 0)
|
||||
@@ -1981,7 +1979,6 @@ z80_ld_mem:
|
||||
}
|
||||
sect_AbsByte(0xE0);
|
||||
sect_AbsByte($2.val & 0xFF);
|
||||
rpn_Free($2);
|
||||
} else {
|
||||
sect_AbsByte(0xEA);
|
||||
sect_RelWord($2, 1);
|
||||
@@ -2039,14 +2036,12 @@ z80_ld_a:
|
||||
}
|
||||
sect_AbsByte(0xF0);
|
||||
sect_AbsByte($4.val & 0xFF);
|
||||
rpn_Free($4);
|
||||
} else {
|
||||
sect_AbsByte(0xFA);
|
||||
sect_RelWord($4, 1);
|
||||
}
|
||||
} else {
|
||||
::error("Destination operand must be A\n");
|
||||
rpn_Free($4);
|
||||
}
|
||||
}
|
||||
;
|
||||
@@ -2173,7 +2168,6 @@ z80_rst:
|
||||
sect_RelByte($2, 0);
|
||||
else
|
||||
sect_AbsByte(0xC7 | $2.val);
|
||||
rpn_Free($2);
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -44,11 +44,6 @@ static uint8_t *reserveSpace(Expression &expr, uint32_t size) {
|
||||
return &expr.rpn[curSize];
|
||||
}
|
||||
|
||||
// Free the RPN expression
|
||||
void rpn_Free(Expression &expr) {
|
||||
initExpression(expr);
|
||||
}
|
||||
|
||||
// Add symbols, constants and operators to expression
|
||||
void rpn_Number(Expression &expr, uint32_t val) {
|
||||
initExpression(expr);
|
||||
|
||||
@@ -729,7 +729,6 @@ void sect_RelByte(Expression &expr, uint32_t pcShift) {
|
||||
} else {
|
||||
writebyte(expr.val);
|
||||
}
|
||||
rpn_Free(expr);
|
||||
}
|
||||
|
||||
// Output several copies of a relocatable byte. Checking will be done to see if
|
||||
@@ -750,9 +749,6 @@ void sect_RelBytes(uint32_t n, std::vector<Expression> &exprs) {
|
||||
writebyte(expr.val);
|
||||
}
|
||||
}
|
||||
|
||||
for (Expression &expr : exprs)
|
||||
rpn_Free(expr);
|
||||
}
|
||||
|
||||
// Output a relocatable word. Checking will be done to see if
|
||||
@@ -769,7 +765,6 @@ void sect_RelWord(Expression &expr, uint32_t pcShift) {
|
||||
} else {
|
||||
writeword(expr.val);
|
||||
}
|
||||
rpn_Free(expr);
|
||||
}
|
||||
|
||||
// Output a relocatable longword. Checking will be done to see if
|
||||
@@ -786,7 +781,6 @@ void sect_RelLong(Expression &expr, uint32_t pcShift) {
|
||||
} else {
|
||||
writelong(expr.val);
|
||||
}
|
||||
rpn_Free(expr);
|
||||
}
|
||||
|
||||
// Output a PC-relative relocatable byte. Checking will be done to see if it
|
||||
@@ -819,7 +813,6 @@ void sect_PCRelByte(Expression &expr, uint32_t pcShift) {
|
||||
writebyte(offset);
|
||||
}
|
||||
}
|
||||
rpn_Free(expr);
|
||||
}
|
||||
|
||||
// Output a binary file
|
||||
|
||||
Reference in New Issue
Block a user