Mercurial > repos > rhope
diff cbackend.rhope @ 69:d0ce696786cc
Clean up debug print statements a bit. Fix bug that prevented workers that took no inputs from working. Remove workaround in Array for said bug.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 16 Jun 2010 04:36:08 +0000 |
parents | d4b44ae2e34a |
children | f7bcf3db1342 |
line wrap: on
line diff
--- a/cbackend.rhope Mon Jun 07 15:36:04 2010 -0400 +++ b/cbackend.rhope Wed Jun 16 04:36:08 2010 +0000 @@ -355,7 +355,6 @@ Type Inits@C Type Registry[reg,method reg,field reg:out] { out <- Fold[[[["_Type Inits C"]Set Input[0, reg]]Set Input[1, method reg]]Set Input[2, field reg], "", [reg]Definitions >>] - { Print["Type inits got output"] } } Register Type@C Type Registry[reg,def:out] @@ -367,7 +366,6 @@ { out <- reg }{ - Print[["Registered def for "]Append[name]] out <- [reg]Definitions <<[[[reg]Definitions >>]Set[name, def]] } }{ @@ -388,13 +386,9 @@ Simple Type?@C Type Registry[reg,name:yep,nope,notfound] { - Print[["Symple Type?: "]Append[name]] ,notfound <- [[reg]Definitions >>]Index[name] { - Print["found type"] yep,nope <- If[[[[~]Fields >>]Length] = [1]] - }{ - Pretty Print[reg, ""] } } @@ -452,15 +446,11 @@ Register Constant@C Function[func,name,constant:out] { - Print["Register Constant"] - Print[name] out <- [func]Constants <<[ [[func]Constants >>]Set[name, constant] ] - { Print["Got register constant output"] } } Allocate Var@C Function[func,name,type:out] { - Print[["Allocate Var: "]Append[name]] out <- [func]Variables <<[ [[func]Variables >>]Set[name,type] ] } @@ -565,14 +555,12 @@ Release@C Function[func,psource:out] { source <- [psource]Make Op[func] - Print[["Release: "]Append[source]] out <- [func]Add Statement[[["release_ref((object *)"]Append[source]]Append[")"]] } Set Null@C Function[func,pdest:out] { dest <- [pdest]Make Op[func] - Print[["Set Null: "]Append[dest]] out <- [func]Add Statement[[dest]Append[" = NULL"]] } @@ -636,7 +624,6 @@ Set Field Null@C Function[func,var,field:out] { - Print["Set Field Null"] out <- [func]Add Statement[ [[func]Field Result[var,field]]Append[" = NULL"] ] } @@ -907,7 +894,6 @@ Naked Proto@C Function[func:out] { - Print[["Naked Proto: "]Append[ [func]Name >>] ] [[func]Output Types >>]Index[0] { outtype <- [Rhope Type to C[~]]Append[" "] @@ -919,7 +905,6 @@ ]Append["("] ]Append[ [Fold[["_Proto Input"]Set Input[3, [func]Input Types >>], (), [func]Inputs >>]]Join[", "] ] ]Append[")"] - { Print[~] } } Type Check@C Function[func,text,type,input num:out] @@ -1089,31 +1074,25 @@ _Set Consts C Program[text,value,name,type reg:out] { - Print[["_Set Consts: "]Append[valtype]] - Pretty Print[value, "_Set Consts: "] //TODO: Support more constant types valtype <- Type Of[value] [("Int32","Whole Number")]Find[valtype] { out <- [text]Append[[[[["\t_const_"]Append[Escape Rhope Name[name]]]Append[" = make_Int32("]]Append[value]]Append[");\n"]] - { Print["_Set Consts got output integer"] } }{ If[[valtype] = ["Type Instance"]] { //TODO: Support parametric types typeid <- [type reg]Type ID[[value]Name >>] out <- [text]Append[[[[["\t_const_"]Append[Escape Rhope Name[name]]]Append[" = make_Blueprint("]]Append[typeid]]Append[");\n"]] - { Print["_Set Consts got output blueprint"] } }{ If[[valtype] = ["Yes No"]] { If[value] { out <- [text]Append[[["\t_const_"]Append[Escape Rhope Name[name]]]Append[" = (object *)val_yes;\n"]] - { Print["_Set Consts got output yes"] } }{ out <- [text]Append[[["\t_const_"]Append[Escape Rhope Name[name]]]Append[" = (object *)val_no;\n"]] - { Print["_Set Consts got output no"] } } }{ If[[valtype] = ["Machine Integer"]] @@ -1279,7 +1258,6 @@ Text@C Program[program:out] { - Print["Text@C Program"] type defs <- [[program]Type Registry >>]Definitions >> constants <- Fold["Combine Consts", Dictionary[], [program]Functions >>] all methods <- Fold["Field to Types", Fold["Method to Types", Dictionary[], type defs], type defs]