diff --git a/include/asm/output.hpp b/include/asm/output.hpp index 7887116c..39f90f01 100644 --- a/include/asm/output.hpp +++ b/include/asm/output.hpp @@ -19,9 +19,7 @@ enum StateFeature { STATE_EQU, STATE_VAR, STATE_EQUS, STATE_CHAR, STATE_MACRO, N void out_RegisterNode(std::shared_ptr node); void out_RegisterSymbol(Symbol &sym); void out_CreatePatch(PatchType type, Expression const &expr, uint32_t ofs, uint32_t pcShift); -void out_CreateAssert( - AssertionType type, Expression const &expr, std::string const &message, uint32_t ofs -); +void out_CreateAssert(AssertionType type, Expression const &expr, std::string const &message); void out_WriteObject(); void out_WriteState(std::string name, std::vector const &features); diff --git a/include/link/patch.hpp b/include/link/patch.hpp index e10ebf1e..e78782ad 100644 --- a/include/link/patch.hpp +++ b/include/link/patch.hpp @@ -12,7 +12,6 @@ struct Symbol; struct Assertion { Expression rpn; - uint32_t offset; AssertionType type; std::string message; // This would be redundant with `rpn.pcSection->fileSymbols`, diff --git a/man/rgbds.5 b/man/rgbds.5 index fb06b506..f1239489 100644 --- a/man/rgbds.5 +++ b/man/rgbds.5 @@ -275,8 +275,6 @@ Assertions are essentially patches with a message. Context in which the assertions was defined. .It Cm LONG Ar LineNo Line number in the context at which the assertion was defined. -.It Cm LONG Ar Offset -Unused leftover from the patch structure. .It Cm LONG Ar PCSectionID ID of the section in which PC is located. .It Cm LONG Ar PCOffset diff --git a/src/asm/actions.cpp b/src/asm/actions.cpp index fe9d320e..dae2feaa 100644 --- a/src/asm/actions.cpp +++ b/src/asm/actions.cpp @@ -126,7 +126,7 @@ void act_Assert(AssertionType type, Expression const &expr, std::string const &m fatal("Assertion messages cannot contain '\\0' characters"); } if (!expr.isKnown()) { - out_CreateAssert(type, expr, message, sect_GetOutputOffset()); + out_CreateAssert(type, expr, message); } else if (expr.value() == 0) { failAssert(type, message); } diff --git a/src/asm/output.cpp b/src/asm/output.cpp index 75b3b34a..36b1f431 100644 --- a/src/asm/output.cpp +++ b/src/asm/output.cpp @@ -33,7 +33,6 @@ struct Assertion { std::shared_ptr src; uint32_t lineNo; - uint32_t offset; Section *pcSection; uint32_t pcOffset; AssertionType type; @@ -160,16 +159,13 @@ void out_CreatePatch(PatchType type, Expression const &expr, uint32_t ofs, uint3 patch.pcOffset -= pcShift; } -void out_CreateAssert( - AssertionType type, Expression const &expr, std::string const &message, uint32_t ofs -) { +void out_CreateAssert(AssertionType type, Expression const &expr, std::string const &message) { Assertion &assertion = assertions.emplace_front(); assertion.type = type; assertion.src = fstk_GetFileStack(); // All assertions are assumed to eventually be written, so the file stack node is registered out_RegisterNode(assertion.src); assertion.lineNo = lexer_GetLineNo(); - assertion.offset = ofs; assertion.pcSection = sect_GetSymbolSection(); assertion.pcOffset = sect_GetSymbolOffset(); expr.encode(assertion.rpn); @@ -181,7 +177,6 @@ static void writeAssert(Assertion const &assert, FILE *file) { putLong(assert.src->ID, file); putLong(assert.lineNo, file); - putLong(assert.offset, file); putLong(assert.pcSection ? assert.pcSection->getID() : UINT32_MAX, file); putLong(assert.pcOffset, file); putc(assert.type, file); diff --git a/src/link/object.cpp b/src/link/object.cpp index 184701f0..8988f84b 100644 --- a/src/link/object.cpp +++ b/src/link/object.cpp @@ -432,13 +432,6 @@ static void readAssertion( fileName, assertID ); - tryReadLong( - assert.offset, - file, - "%s: Cannot read assertion #%" PRIu32 "'s offset: %s", - fileName, - assertID - ); tryReadLong( assert.rpn.pcSectionID, file,