mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Move label relocs to the relevant statement block.
This commit is contained in:
parent
849d013f5e
commit
fd3b594ca5
2 changed files with 12 additions and 0 deletions
|
@ -60,6 +60,8 @@ typedef struct statement_s {
|
|||
|
||||
typedef struct sblock_s {
|
||||
struct sblock_s *next;
|
||||
struct reloc_s *relocs;
|
||||
int offset; ///< offset of first statement of block
|
||||
statement_t *statements;
|
||||
statement_t **tail;
|
||||
} sblock_t;
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "options.h"
|
||||
#include "qc-parse.h"
|
||||
#include "qfcc.h"
|
||||
#include "reloc.h"
|
||||
#include "statements.h"
|
||||
#include "strpool.h"
|
||||
#include "symtab.h"
|
||||
|
@ -652,11 +653,20 @@ statement_bool (sblock_t *sblock, expr_t *e)
|
|||
static sblock_t *
|
||||
statement_label (sblock_t *sblock, expr_t *e)
|
||||
{
|
||||
reloc_t *r;
|
||||
|
||||
if (sblock->statements) {
|
||||
sblock->next = new_sblock ();
|
||||
sblock = sblock->next;
|
||||
}
|
||||
e->e.label.dest = sblock;
|
||||
for (r = e->e.label.refs; r && r->next; r = r->next)
|
||||
;
|
||||
if (r) {
|
||||
r->next = sblock->relocs;
|
||||
sblock->relocs = e->e.label.refs;
|
||||
e->e.label.refs = 0;
|
||||
}
|
||||
return sblock;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue