Mercurial > repos > rhope
diff cbackend_c.rhope @ 169:fd06fb07762a
Basic inlining of arithmetic and comparison operations on integer types
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 08 May 2011 01:37:44 -0700 |
parents | bac2c74801f0 |
children | ac5c2d78663f |
line wrap: on
line diff
--- a/cbackend_c.rhope Sun May 01 18:41:17 2011 -0700 +++ b/cbackend_c.rhope Sun May 08 01:37:44 2011 -0700 @@ -513,6 +513,12 @@ out <- [["add_ref((object *)"]Append[ [val]Make Op[func] ]]Append[")"] } +Cast Value@C Function[func,op,type:out] +{ + tname <- Rhope Type to C[type, [func]Escape Pattern >>] + out <- [[[["(("]Append[tname]]Append[")"]]Append[Make Op[op, func]]]Append[")"] +} + Add@C Function[func,source1,source2,dest:out] { out <- [func]Add Operator Statement[source1,source2,dest," + "]