Run through clang-format.

This commit is contained in:
David Given 2016-08-21 18:51:36 +02:00
parent 03a0b182c4
commit a4f136f999

View file

@ -9,7 +9,6 @@
*
*/
#include <stdio.h>
#include "types.h"
#include "debug.h"
@ -22,15 +21,12 @@
#include "alloc.h"
#include "go.h"
STATIC bool report_flag = FALSE; /* report #optimizations found? */
#ifdef DEBUG
STATIC bool core_flag = FALSE; /* report core usage? */
#endif
STATIC mach_init(machfile,phase_machinit)
char *machfile;
STATIC mach_init(machfile, phase_machinit) char* machfile;
int (*phase_machinit)();
{
/* Read target machine dependent information */
@ -40,15 +36,13 @@ STATIC mach_init(machfile,phase_machinit)
f = openfile(machfile, "r");
fscanf(f, "%d", &ws);
fscanf(f, "%d", &ps);
if (ws != ps && ps != 2*ws) error("illegal pointer size");
if (ws != ps && ps != 2 * ws)
error("illegal pointer size");
(*phase_machinit)(f);
fclose(f);
}
go(argc,argv,initialize,optimize,phase_machinit,proc_flag)
int argc;
go(argc, argv, initialize, optimize, phase_machinit, proc_flag) int argc;
char* argv[];
int (*initialize)();
int (*optimize)();
@ -66,10 +60,13 @@ go(argc,argv,initialize,optimize,phase_machinit,proc_flag)
bool time_opt = TRUE;
linecount = 0;
for (i = ARGSTART; i < argc; i++) {
for (i = ARGSTART; i < argc; i++)
{
p = argv[i];
if (*p++ != '-') error("illegal argument");
switch(*p) {
if (*p++ != '-')
error("illegal argument");
switch (*p)
{
case 'S':
time_opt = FALSE;
break;
@ -100,17 +97,20 @@ go(argc,argv,initialize,optimize,phase_machinit,proc_flag)
fproc = getptable(pname); /* proc table */
fdblock = getdtable(dname); /* data block table */
(*initialize)();
if (optimize == no_action) return;
if (optimize == no_action)
return;
f = openfile(lname, "r");
gf = openfile(bname, "r");
f2 = openfile(lname2, "w");
gf2 = openfile(bname2, "w");
mesregs = Lempty_set();
while (getunit(gf,f,&kind,&g,&l,&curproc,TRUE)) {
while (getunit(gf, f, &kind, &g, &l, &curproc, TRUE))
{
/* Read the control flow graph and EM text of
* one procedure and optimize it.
*/
if (kind == LDATA) {
if (kind == LDATA)
{
putunit(LDATA, (proc_p)0, l, gf2, f2);
continue;
}
@ -139,25 +139,25 @@ go(argc,argv,initialize,optimize,phase_machinit,proc_flag)
core_usage();
}
no_action() {}
core_usage()
{
#ifdef DEBUG
if (core_flag) {
if (core_flag)
{
coreusage();
}
#endif
}
report(s,n)
char *s;
report(s, n) char* s;
int n;
{
/* Report number of optimizations found, if report_flag is set */
if (report_flag) {
if (report_flag)
{
fprintf(stderr, "%s: %d\n", s, n);
}
}