aboutsummaryrefslogtreecommitdiff
path: root/src/interp/c-util.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/c-util.boot')
-rw-r--r--src/interp/c-util.boot8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 945ac812..3d050c51 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -41,6 +41,7 @@ module c_-util where
replaceSimpleFunctions: %Form -> %Form
foldExportedFunctionReferences: %List -> %List
diagnoseUnknownType: (%Mode,%Env) -> %Form
+ declareUnusedParameters: (%List,%Code) -> %List
--%
@@ -121,6 +122,13 @@ wantArgumentsAsTuple: (%List,%Signature) -> %Boolean
wantArgumentsAsTuple(args,sig) ==
isHomoegenousVarargSignature sig and #args ^= #sig
+++ We are about to seal the (Lisp) definition of a function.
+++ Augment the `body' with a declaration for those `parms'
+++ that are unused.
+declareUnusedParameters(parms,body) ==
+ unused := [p for p in parms | not CONTAINED(p,body)]
+ null unused => [body]
+ [["DECLARE",["IGNORE",:unused]],body]
devaluate d ==
not REFVECP d => d