aboutsummaryrefslogtreecommitdiff
path: root/src/interp/c-util.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2013-05-29 12:40:21 +0000
committerdos-reis <gdr@axiomatics.org>2013-05-29 12:40:21 +0000
commit2b324bcfd116749f4966dd1948f0d9bf7b4a0033 (patch)
tree10ed1be3212576c7ea8fadeb470fd8db36f0053b /src/interp/c-util.boot
parent3e326898dae226b97b4234ae45bf0eb2620176ec (diff)
downloadopen-axiom-2b324bcfd116749f4966dd1948f0d9bf7b4a0033.tar.gz
Misc backend cleanup.
Diffstat (limited to 'src/interp/c-util.boot')
-rw-r--r--src/interp/c-util.boot21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index a5496abc..20768ba8 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1308,15 +1308,22 @@ clearReplacement name ==
property(name,"SPADreplace") := nil
property(name,'%redex) := nil
+printBackendStmt(db,stmt) ==
+ printBackendDecl(nil,stmt)
+
+evalAndPrintBackendStmt(db,stmt) ==
+ eval stmt
+ printBackendStmt(db,stmt)
+
++ Register the inlinable form of a function.
registerFunctionReplacement(db,name,body) ==
- evalAndPrintBackendStmt
- ["PUT",MKQ name,MKQ "SPADreplace",quoteMinimally body]
+ evalAndPrintBackendStmt(db,
+ ["PUT",MKQ name,MKQ "SPADreplace",quoteMinimally body])
++ Remember the redex form of this function
registerRedexForm(db,name,parms,body) ==
- evalAndPrintBackendStmt
- ["PUT",quote name,quote '%redex,quote ['ILAM,parms,body]]
+ evalAndPrintBackendStmt(db,
+ ["PUT",quote name,quote '%redex,quote ['ILAM,parms,body]])
++ Retrieve the redex form of the function `name'.
redexForm name ==
@@ -1492,10 +1499,10 @@ setCompilerOptimizations level ==
++ Note that all capsule functions take an additional argument
++ standing for the domain of computation object.
proclaimCapsuleFunction(db,op,sig) ==
- printBackendStmt
+ printBackendStmt(db,
["DECLAIM",["FTYPE",
["FUNCTION",[:[vmType first d for d in tails rest sig],"%Shell"],
- vmType first sig],op]] where
+ vmType first sig],op]]) where
vmType d ==
$subdomain and d = "$" =>
-- We want accurate approximation for subdomains/superdomains
@@ -1547,7 +1554,7 @@ backendCompileSPADSLAM(db,name,args,body) ==
["PROGN",["SETQ",g2,app],
["SETQ",al,["cons5",["CONS",key,g2],al]],g2]]]]
-- define the global cache.
- evalAndPrintBackendDecl(al,['DEFPARAMETER,al,nil])
+ evalAndPrintBackendStmt(db,['DEFPARAMETER,al,nil])
assembleCode [auxfn,["LAMBDA",args,:body]]
assembleCode [name,["LAMBDA",args,code]]