Merge pull request #87 from davidgiven/dtrg-travis

Get clang working on travis.
This commit is contained in:
David Given 2018-06-02 23:00:48 +03:00 committed by GitHub
commit b8cb840c12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 37 deletions

View file

@ -20,5 +20,5 @@ matrix:
git: git:
depth: 10 depth: 10
script: script:
- make PREFIX=/tmp/acki +ack - make CC=$CC PREFIX=/tmp/acki +ack

View file

@ -22,9 +22,9 @@ PREFIX = $(INSDIR)
BUILDDIR = $(ACK_TEMP_DIR)/ack-build BUILDDIR = $(ACK_TEMP_DIR)/ack-build
# What build flags do you want to use? # What build flags do you want to use for native code?
CFLAGS = -g CFLAGS = -g -O -Wno-return-type
LDFLAGS = LDFLAGS =
# Various commands. # Various commands.
@ -120,6 +120,7 @@ $(build-file): first/ackbuilder.lua Makefile $(lua-files) $(our-lua)
PREFIX=$(PREFIX) \ PREFIX=$(PREFIX) \
AR=$(AR) \ AR=$(AR) \
CC=$(CC) \ CC=$(CC) \
CFLAGS="$(CFLAGS)" \
> $(build-file) > $(build-file)
install: install:

View file

@ -1,5 +1,5 @@
vars.cflags = { vars.cflags = {
"-g", "-O" "$(CFLAGS)"
} }
vars.ackcflags = { vars.ackcflags = {
"-O6" "-O6"

View file

@ -237,7 +237,6 @@ float_cst(str, sz, buf)
#endif /* USE_FLT */ #endif /* USE_FLT */
#ifdef CODE_GENERATOR #ifdef CODE_GENERATOR
void
con_float() con_float()
{ {
char buf[8]; char buf[8];

View file

@ -22,27 +22,32 @@ static char rcsid[] = "$Id$";
extern string myalloc(); extern string myalloc();
int rar[MAXCREG]; int rar[MAXCREG];
rl_p *lar; rl_p* lar;
int maxindex; int maxindex;
int regclass[NREGS]; int regclass[NREGS];
struct perm *perms; struct perm* perms;
struct perm * void permute(int index);
tuples(regls,nregneeded) rl_p *regls; {
int class=0; struct perm* tuples(rl_p* regls, int nregneeded)
register i,j; {
int class = 0;
register i, j;
/* /*
* First compute equivalence classes of registers. * First compute equivalence classes of registers.
*/ */
for (i=0;i<NREGS;i++) { for (i = 0; i < NREGS; i++)
regclass[i] = class++; {
if (getrefcount(i, FALSE) == 0) { regclass[i] = class ++;
for (j=0;j<i;j++) { if (getrefcount(i, FALSE) == 0)
if (eqregclass(i,j) && {
eqtoken(&machregs[i].r_contents, for (j = 0; j < i; j++)
&machregs[j].r_contents)) { {
if (eqregclass(i, j) && eqtoken(&machregs[i].r_contents,
&machregs[j].r_contents))
{
regclass[i] = regclass[j]; regclass[i] = regclass[j];
break; break;
} }
@ -58,37 +63,42 @@ tuples(regls,nregneeded) rl_p *regls; {
lar = regls; lar = regls;
perms = 0; perms = 0;
permute(0); permute(0);
return(perms); return (perms);
} }
permute(index) { void permute(int index)
register struct perm *pp; {
register struct perm* pp;
register rl_p rlp; register rl_p rlp;
register i,j; register i, j;
if (index == maxindex) { if (index == maxindex)
for (pp=perms; pp != 0; pp=pp->p_next) { {
for (i=0; i<maxindex; i++) for (pp = perms; pp != 0; pp = pp->p_next)
{
for (i = 0; i < maxindex; i++)
if (regclass[rar[i]] != regclass[pp->p_rar[i]]) if (regclass[rar[i]] != regclass[pp->p_rar[i]])
goto diff; goto diff;
for (i=0; i<maxindex; i++) for (i = 0; i < maxindex; i++)
for (j=0; j<i; j++) for (j = 0; j < i; j++)
if (clash(rar[i],rar[j]) != if (clash(rar[i], rar[j]) != clash(pp->p_rar[i], pp->p_rar[j]))
clash(pp->p_rar[i],pp->p_rar[j]))
goto diff; goto diff;
return; return;
diff: ; diff:;
} }
pp = (struct perm *) myalloc(sizeof ( *pp )); pp = (struct perm*)myalloc(sizeof(*pp));
pp->p_next = perms; pp->p_next = perms;
for (i=0; i<maxindex; i++) for (i = 0; i < maxindex; i++)
pp->p_rar[i] = rar[i]; pp->p_rar[i] = rar[i];
perms = pp; perms = pp;
} else { }
rlp=lar[index]; else
for (i=rlp->rl_n-1; i>=0; i--) { {
rlp = lar[index];
for (i = rlp->rl_n - 1; i >= 0; i--)
{
rar[index] = rlp->rl_list[i]; rar[index] = rlp->rl_list[i];
permute(index+1); permute(index + 1);
} }
} }
} }

View file

@ -83,7 +83,7 @@ extern short em_ptyp[];
/* machine dependent */ /* machine dependent */
void con_part(int, word); void con_part(int, word);
void con_mult(word); void con_mult(word);
void con_float(void); int con_float(void); /* actually returns void, but need K&R C compatibility */
void prolog(full nlocals); void prolog(full nlocals);
void mes(word); void mes(word);