[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-384-g1498662
Benoit Sonntag
sonntag at icps.u-strasbg.fr
Tue Aug 4 16:06:30 UTC 2009
The following commit has been merged in the master branch:
commit 149866286e42733936489f974529923b1b74b363
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date: Tue Aug 4 18:06:25 2009 +0200
bootstrap step #1 ok
diff --git a/lib/string/abstract_string.li b/lib/string/abstract_string.li
index 17fe6d6..5afbb6a 100644
--- a/lib/string/abstract_string.li
+++ b/lib/string/abstract_string.li
@@ -921,7 +921,9 @@ Section Public
- print <-
(
- IO.put_string Self;
+ IO.put_string Self;
+ print_runtime_stack;
+ die_with_code 0;
);
- printline <-
diff --git a/src/code_life/call_slot.li b/src/code_life/call_slot.li
index 0996592..8b4240d 100644
--- a/src/code_life/call_slot.li
+++ b/src/code_life/call_slot.li
@@ -184,9 +184,9 @@ Section Private
+ new_src:LIST;
+ wrt:WRITE;
+ old_val:EXPR;
- + rd:READ_LOCAL;
+ //+ rd:READ_LOCAL;
+ loc:LOCAL;
- // + prof_block:PROFIL_BLOCK;
+ + prof_block:PROFIL_BLOCK;
(source = list_current).if {
POSITION.put_error semantic text "Recursivity without end (call_slot).";
@@ -198,7 +198,7 @@ Section Private
(
(! is_interrupt) && {! is_external} &&
{(cop_argument = NULL) || {! profil.result_list.is_empty}}
- ).if {
+ ).if {
(profil.link_count = 1).if {
//
// Inlining simple.
@@ -219,22 +219,26 @@ Section Private
//
(list_current.old_seq_or_and = seq_or_and).if {
profil.unlink Self;
- LOCAL.alias_on;
- /*
- "Write : ".print;
- (result_list.lower).to (result_list.upper) do { j:INTEGER;
- result_list.item j.debug_display;
- };
- "Source : ".print;
- source.debug_display;
- "--------------------\n".print;
- */
+
+ prof_block ?= profil;
+ (prof_block != NULL).if {
+ (profil.argument_list.lower).to (profil.argument_list.upper) do { j:INTEGER;
+ loc := profil.argument_list.item j;
+ (loc != NULL).if {
+ loc.set_my_alias (loc.my_copy);
+ };
+ };
+ } else {
+ LOCAL.alias_on;
+ };
+ //LOCAL.alias_on;
+
new_src := source.my_copy;
- argument_to_assignment new_src index 1 alias TRUE;
+ argument_to_assignment new_src index 1 alias TRUE;
(result_list.lower).to (result_list.upper) do { j:INTEGER;
wrt := result_list.item j.write;
old_val := wrt.value;
-
+ /*
rd ?= old_val;
loc := rd.local;
(loc.my_alias = NULL).if {
@@ -242,18 +246,25 @@ Section Private
warning_error (position,"CALL_SLOT : Result bizarre!");
warning_error (profil.slot.position,"CALL_SLOT : Result bizarre!");
crash_with_message "CALL_SLOT: Result not affect!";
- };
+ };*/
wrt.set_value (old_val.my_copy);
old_val.remove;
new_src.add_last wrt;
};
- LOCAL.alias_off;
- /*
- "Copy:".print;
- new_src.debug_display;
- "===========================FIN============================\n".print;
- */
+ (prof_block != NULL).if {
+ (profil.argument_list.lower).to (profil.argument_list.upper) do { j:INTEGER;
+ loc := profil.argument_list.item j;
+ (loc != NULL).if {
+ loc.set_my_alias NULL;
+ };
+ };
+ } else {
+ LOCAL.alias_off;
+ };
+
+ //LOCAL.alias_off;
+
result := new_src.execute;
is_good := TRUE;
new_execute_pass;
@@ -599,7 +610,7 @@ Section Private
(is_alias).if {
loc ?= val.variable;
new_wrt := loc.write (val.position) value (val.value);
- loc.unwrite val;
+ loc.unwrite val;
} else {
new_wrt := val;
};
diff --git a/src/code_life/read.li b/src/code_life/read.li
index 5758d54..db930ab 100644
--- a/src/code_life/read.li
+++ b/src/code_life/read.li
@@ -85,7 +85,7 @@ Section Public
"style [".print; variable.style.print; "]\n".print;
warning_error (position,"READ : Compiler BUG! (require_first = NULL) ");
//list_current.debug_display;
- //die_with_code 0;
+ die_with_code 0;
//crash_with_message "BUG READ : require_first = NULL";
};
@@ -142,12 +142,7 @@ Section Public
variable.get_type tmp_type;
(tmp_type.first = TYPE_NULL).if {
tmp_type.remove_first;
- };
- (variable.name == "storage").if {
- variable.intern_name.print; ' '.print;
- tmp_type.count.print;
- '\n'.print;
- };
+ };
(tmp_type.count = 1).if {
variable.set_type (tmp_type.first.default.to_strict);
};
diff --git a/src/code_life/write.li b/src/code_life/write.li
index b5125dd..091473a 100644
--- a/src/code_life/write.li
+++ b/src/code_life/write.li
@@ -185,7 +185,7 @@ Section Public
(
variable.unwrite Self;
value.remove;
- //free_allocation_memory;
+ //free_allocation_memory;
);
//
diff --git a/src/code_life/write_local.li b/src/code_life/write_local.li
index 7187d03..881b994 100644
--- a/src/code_life/write_local.li
+++ b/src/code_life/write_local.li
@@ -54,7 +54,7 @@ Section Public
(
position := p;
local := l;
- value := val;
+ value := val;
);
//
diff --git a/src/constant/integer_cst.li b/src/constant/integer_cst.li
index a25eb62..d3caf9c 100644
--- a/src/constant/integer_cst.li
+++ b/src/constant/integer_cst.li
@@ -135,7 +135,7 @@ Section Public
- cast_type p:TYPE_FULL <-
(
- ? { p.raw != type_integer };
+// ? { p.raw != type_integer };
static_type := p;
check_type;
);
diff --git a/src/external/call_null.li b/src/external/call_null.li
index 7a0251d..4324ea8 100644
--- a/src/external/call_null.li
+++ b/src/external/call_null.li
@@ -64,7 +64,7 @@ Section Public
} else {
code :=
"print_string(\"Call on NULL\\n\
- \(Use `-D' option)\\n\"); \
+ \(Use `debug' option)\\n\"); \
\die_with_code(1)";
};
buffer.append code;
diff --git a/src/lisaac.li b/src/lisaac.li
index 5eb154e..745596a 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -352,7 +352,7 @@ Section Private
\\n";
} else {
buf.append
- "void print_string(char *str) \n\
+ "int print_string(char *str) \n\
\{ \n\
\ while (*str!=0) {\n\
\ print_char(*str); \n\
@@ -688,11 +688,8 @@ Section Public
// Debug source code.
(is_java).if_false {
- ((debug_level_option != 0) || {CALL_NULL.is_necessary}).if {
- output_code.append "// Debug Manager\n";
- output_code.append "void print_string(char *str);\n";
- };
(debug_level_option != 0).if {
+ output_code.append "// Debug Manager\n";
(is_ansi).if {
output_code.append "void interrupt_signal(int sig);\n";
};
diff --git a/src2/code_life/call_slot.li b/src2/code_life/call_slot.li
index 00f372d..be3552d 100644
--- a/src2/code_life/call_slot.li
+++ b/src2/code_life/call_slot.li
@@ -183,10 +183,9 @@ Section Private
+ is_good:BOOLEAN;
+ new_src:LIST;
+ wrt:WRITE;
- + old_val:EXPR;
- + rd:READ_LOCAL;
+ + old_val:EXPR;
+ loc:LOCAL;
- // + prof_block:PROFIL_BLOCK;
+ + prof_block:PROFIL_BLOCK;
(source = list_current).if {
POSITION.put_error semantic text "Recursivity without end (call_slot).";
@@ -219,41 +218,42 @@ Section Private
//
(list_current.old_seq_or_and = seq_or_and).if {
profil.unlink Self;
- LOCAL.alias_on;
- /*
- "Write : ".print;
- (result_list.lower).to (result_list.upper) do { j:INTEGER;
- result_list.item j.debug_display;
- };
- "Source : ".print;
- source.debug_display;
- "--------------------\n".print;
- */
+
+ prof_block ?= profil;
+ (prof_block != NULL).if {
+ (profil.argument_list.lower).to (profil.argument_list.upper) do { j:INTEGER;
+ loc := profil.argument_list.item j;
+ (loc != NULL).if {
+ loc.set_my_alias (loc.my_copy);
+ };
+ };
+ } else {
+ LOCAL.alias_on;
+ };
+ //LOCAL.alias_on;
+
new_src := source.my_copy;
argument_to_assignment new_src index 1 alias TRUE;
(result_list.lower).to (result_list.upper) do { j:INTEGER;
wrt := result_list.item j.write;
- old_val := wrt.value;
-
- rd ?= old_val;
- loc := rd.local;
- (loc.my_alias = NULL).if {
- profil.slot.name.print; '\n'.print;
- warning_error (position,"CALL_SLOT : Result bizarre!");
- warning_error (profil.slot.position,"CALL_SLOT : Result bizarre!");
- crash_with_message "CALL_SLOT: Result not affect!";
- };
+ old_val := wrt.value;
wrt.set_value (old_val.my_copy);
old_val.remove;
new_src.add_last wrt;
};
- LOCAL.alias_off;
- /*
- "Copy:".print;
- new_src.debug_display;
- "===========================FIN============================\n".print;
- */
+ (prof_block != NULL).if {
+ (profil.argument_list.lower).to (profil.argument_list.upper) do { j:INTEGER;
+ loc := profil.argument_list.item j;
+ (loc != NULL).if {
+ loc.set_my_alias NULL;
+ };
+ };
+ } else {
+ LOCAL.alias_off;
+ };
+ //LOCAL.alias_off;
+
result := new_src.execute;
is_good := TRUE;
new_execute_pass;
diff --git a/src2/code_life/read.li b/src2/code_life/read.li
index e02cf5c..18ec91b 100644
--- a/src2/code_life/read.li
+++ b/src2/code_life/read.li
@@ -142,12 +142,7 @@ Section Public
variable.get_type tmp_type;
(tmp_type.first = TYPE_NULL).if {
tmp_type.remove_first;
- };
- (variable.name == "storage").if {
- variable.intern_name.print; ' '.print;
- tmp_type.count.print;
- '\n'.print;
- };
+ };
(tmp_type.count = 1).if {
variable.set_type (tmp_type.first.default.to_strict);
};
diff --git a/src2/lisaac.li b/src2/lisaac.li
index e99e3aa..72b8ad2 100644
--- a/src2/lisaac.li
+++ b/src2/lisaac.li
@@ -353,7 +353,7 @@ Section Private
\\n";
} else {
buf.append
- "void print_string(char *str) \n\
+ "int print_string(char *str) \n\
\{ \n\
\ while (*str!=0) {\n\
\ print_char(*str); \n\
@@ -689,11 +689,8 @@ Section Public
// Debug source code.
(is_java).if_false {
- ((debug_level_option != 0) || {CALL_NULL.is_necessary}).if {
- output_code.append "// Debug Manager\n";
- output_code.append "void print_string(char *str);\n";
- };
(debug_level_option != 0).if {
+ output_code.append "// Debug Manager\n";
(is_ansi).if {
output_code.append "void interrupt_signal(int sig);\n";
};
--
Lisaac compiler
More information about the Lisaac-commits
mailing list