CPPFLAGS += -I$(top_srcdir)/ir/ir -I$(top_srcdir)/ir/common \
-I$(top_srcdir)/ir/ident -I$(top_srcdir)/ir/tr \
-I$(top_srcdir)/ir/tv -I$(top_srcdir)/ir/debug \
- -I$(top_srcdir)/ir/ana -I$(top_stcdir)/ir/opt \
+ -I$(top_srcdir)/ir/ana -I$(top_srcdir)/ir/opt \
-I$(top_srcdir)/ir/st
LDFLAGS += -I$(topdir)
ir/ircons.h ir/ircgcons.h ir/irflag.h ir/irvrfy.h ir/irdump.h \
ir/iropt.h ir/irgopt.h ir/ircgopt.h \
ana/irouts.h ana/irdom.h ana/irloop.h ana/cgana.h \
- ir/irgmod.h tr/typegmod.h
+ ir/irgmod.h tr/typegmod.h opt/tailrec.h
FIRM_SOURCE_DIR_HEADERS=$(addprefix $(SOURCE_DIR)/,$(FIRM_HEADERS))
$scndlastline = "";
$lastline = "";
+$eat = 0;
+
foreach $line (@lines) {
- if (($line =~ /^\#/) ) {
+ if ($line =~ /\#ifdef __cplusplus/) {
+# There is extern "C" in firm.h, guarded by #ifdef __cplusplus
+# crecoder does not grok the extern "C", so remove thses three lines.
+ $eat = 2;
+ } elsif ($eat > 0) {
+ $eat = $eat -1;
+ } elsif (($line =~ /^\#/) ) {
# eat the line
$scndlastline = $lastline;
$lastline = $line;
$guardedtypedef = 0;
}
}
- } elsif ($line =~ /extern "C"/) {
- print OUT "/* extern C */ {";
} else {
print OUT "$line";
$scndlastline = $lastline;