mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Use automatic allocation and std::move for RPN bytes (#1336)
This commit is contained in:
@@ -16,23 +16,32 @@ struct Expression {
|
||||
std::string reason; // Why the expression is not known, if it isn't
|
||||
bool isKnown; // Whether the expression's value is known at assembly time
|
||||
bool isSymbol; // Whether the expression represents a symbol suitable for const diffing
|
||||
std::vector<uint8_t> *rpn; // Bytes serializing the RPN expression
|
||||
uint32_t rpnPatchSize; // Size the expression will take in the object file
|
||||
std::vector<uint8_t> rpn; // Bytes serializing the RPN expression
|
||||
uint32_t rpnPatchSize; // Size the expression will take in the object file
|
||||
|
||||
int32_t getConstVal() const;
|
||||
Symbol const *symbolOf() const;
|
||||
bool isDiffConstant(Symbol const *symName) const;
|
||||
|
||||
Expression() = default;
|
||||
Expression(Expression &&) = default;
|
||||
#ifdef _MSC_VER
|
||||
// MSVC and WinFlexBison won't build without this...
|
||||
Expression(const Expression &) = default;
|
||||
#endif
|
||||
|
||||
Expression &operator=(Expression &&) = default;
|
||||
};
|
||||
|
||||
void rpn_Number(Expression &expr, uint32_t val);
|
||||
void rpn_Symbol(Expression &expr, char const *symName);
|
||||
void rpn_LOGNOT(Expression &expr, const Expression &src);
|
||||
void rpn_BinaryOp(RPNCommand op, Expression &expr, const Expression &src1, const Expression &src2);
|
||||
void rpn_HIGH(Expression &expr, const Expression &src);
|
||||
void rpn_LOW(Expression &expr, const Expression &src);
|
||||
void rpn_LOGNOT(Expression &expr, Expression &&src);
|
||||
void rpn_BinaryOp(RPNCommand op, Expression &expr, Expression &&src1, const Expression &src2);
|
||||
void rpn_HIGH(Expression &expr, Expression &&src);
|
||||
void rpn_LOW(Expression &expr, Expression &&src);
|
||||
void rpn_ISCONST(Expression &expr, const Expression &src);
|
||||
void rpn_NEG(Expression &expr, const Expression &src);
|
||||
void rpn_NOT(Expression &expr, const Expression &src);
|
||||
void rpn_NEG(Expression &expr, Expression &&src);
|
||||
void rpn_NOT(Expression &expr, Expression &&src);
|
||||
void rpn_BankSymbol(Expression &expr, char const *symName);
|
||||
void rpn_BankSection(Expression &expr, char const *sectionName);
|
||||
void rpn_BankSelf(Expression &expr);
|
||||
@@ -43,8 +52,8 @@ void rpn_StartOfSectionType(Expression &expr, SectionType type);
|
||||
|
||||
void rpn_Free(Expression &expr);
|
||||
|
||||
void rpn_CheckHRAM(Expression &expr, const Expression &src);
|
||||
void rpn_CheckRST(Expression &expr, const Expression &src);
|
||||
void rpn_CheckNBit(Expression const &expr, uint8_t n);
|
||||
void rpn_CheckHRAM(Expression &expr);
|
||||
void rpn_CheckRST(Expression &expr);
|
||||
void rpn_CheckNBit(const Expression &expr, uint8_t n);
|
||||
|
||||
#endif // RGBDS_ASM_RPN_H
|
||||
|
||||
Reference in New Issue
Block a user