Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCC common code changes from Gigatron-LCC #48

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e979d9a
support for comments in md files
lb3361 Mar 23, 2021
40266fe
added c++ style comments
lb3361 Mar 25, 2021
61abf66
(cpp) Redefine memmove as mymemmove.
lb3361 Sep 8, 2021
7e12cb4
(lcc) make sure NEW aligns for all builtin types (including long double)
lb3361 Sep 8, 2021
2ed83a0
(cpp) added option -i to include a specific file before processing an…
lb3361 May 24, 2021
1fb732c
(main.c) report number of errors before bailing out.
lb3361 May 7, 2021
a8f5e7a
(gen.c) moveself proofed against LOAD other than reg:LOAD(reg)
lb3361 May 5, 2021
2decd48
Use #line directives in lburg output
lb3361 Mar 26, 2021
9efaed9
(gen.c) emitasm now calls an IR function emitfmt
leonbottou Sep 8, 2021
ce51780
increased x.kids size.
lb3361 Mar 24, 2021
0d1b597
(gen.c) genreload rewrites from the correct non terminal instead of 1
leonbottou Sep 8, 2021
c94e528
added IR flag wants_cvuf_cvfu for backends that know better.
leonbottou Sep 8, 2021
367d3ab
Implement correct type promotion rules for binary ops
leonbottou Sep 8, 2021
2595c62
prelabel eliminates null type conversions
leonbottou Sep 8, 2021
80bf176
Bonus matches are no longer constrained to have zero costs.
leonbottou Sep 8, 2021
c9ed065
(enode.c) made chain of condtree more efficient
leonbottou Sep 8, 2021
7184d8a
(gen.c,tree.c,expr.c) dumptree prints load types, implicit calls warned
lb3361 Apr 30, 2021
1d6b633
(simp.c) explicit cast of constant folds it
lb3361 Apr 30, 2021
1052b04
(dag.c) assignargs does register-to-register copy
lb3361 May 3, 2021
3df50dc
(gen.c) variable 'spilling' set while spilling can be used to select …
lb3361 May 5, 2021
4e8b1d5
(gen.c) Added IR->x.preralloc()
lb3361 Jun 7, 2021
a6c99fb
(dag.c) preserve cse information when avoiding replace
lb3361 Jun 22, 2021
5ea600f
(enode.c) using signedptr for pointer difference arguments
lb3361 Jun 30, 2021
e36a82e
Cast printf argument in cpp/tokens.c because longs...
leonbottou Sep 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cpp/cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@ extern int Cplusplus;
extern Nlist *kwdefined;
extern Includelist includelist[NINCLUDE];
extern char wd[];

#define memmove mymemmove
extern void *memmove(void *dp, const void *sp, size_t n);
2 changes: 1 addition & 1 deletion cpp/tokens.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ peektokens(Tokenrow *trp, char *str)
if (str)
fprintf(stderr, "%s ", str);
if (tp<trp->bp || tp>trp->lp)
fprintf(stderr, "(tp offset %d) ", tp-trp->bp);
fprintf(stderr, "(tp offset %d) ", (int)(tp-trp->bp));
for (tp=trp->bp; tp<trp->lp && tp<trp->bp+32; tp++) {
if (tp->type!=NL) {
int c = tp->t[tp->len];
Expand Down
16 changes: 15 additions & 1 deletion cpp/unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ setup(int argc, char **argv)
FILE *fd;
char *fp, *dp;
Tokenrow tr;
char *preincl = 0;
FILE *prefd = 0;
extern void setup_kwtab(void);

setup_kwtab();
while ((c = getopt(argc, argv, "MNOVv+I:D:U:F:lg")) != -1)
while ((c = getopt(argc, argv, "MNOVv+I:D:U:F:lgi:")) != -1)
switch (c) {
case 'N':
for (i=0; i<NINCLUDE; i++)
Expand Down Expand Up @@ -60,6 +62,13 @@ setup(int argc, char **argv)
case '+':
Cplusplus++;
break;
case 'i':
if (preincl)
error(FATAL, "Too many -i options");
preincl = optarg;
if ((prefd = fopen(preincl, "r")) == NULL)
error(FATAL, "Cannot open -i file %s", preincl);
break;
default:
break;
}
Expand All @@ -86,6 +95,11 @@ setup(int argc, char **argv)
includelist[NINCLUDE-1].always = 0;
includelist[NINCLUDE-1].file = dp;
setsource(fp, fd, NULL);
if (preincl && prefd) {
incdepth += 1;
genline(); /* first file must be fp */
setsource(preincl, prefd, NULL);
}
}


Expand Down
Loading