scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <scc/scc.h>
 2
 3#include "../cc2.h"
 4#include "arch.h"
 5
 6static void
 7deljmp(void)
 8{
 9	if (!pc)
10		return;
11
12	if (pc->op == ASJP || pc->op == ASJR) {
13		if (pc->from1.u.sym == pc->next->label)
14			delcode();
15	}
16}
17
18void
19peephole(void)
20{
21	for (pc = prog; pc; pc = pc->next) {
22		deljmp();
23	}
24}