Module Name:    src
Committed By:   rillig
Date:           Tue Aug 10 07:02:00 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: ops.def

Log Message:
lint: document the difference between FARG and PUSH


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/lint1/ops.def

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/ops.def
diff -u src/usr.bin/xlint/lint1/ops.def:1.21 src/usr.bin/xlint/lint1/ops.def:1.22
--- src/usr.bin/xlint/lint1/ops.def:1.21	Tue Aug 10 06:31:16 2021
+++ src/usr.bin/xlint/lint1/ops.def	Tue Aug 10 07:02:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ops.def,v 1.21 2021/08/10 06:31:16 rillig Exp $ */
+/*	$NetBSD: ops.def,v 1.22 2021/08/10 07:02:00 rillig Exp $ */
 
 begin_ops()
 
@@ -104,6 +104,16 @@ op(	INIT,	"init",		1,-,1,-,-,-,-,-,-,-,-
 op(	CASE,	"case",		-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-)
 op(	FARG,	"farg",		1,-,1,-,-,-,-,-,-,-,-,-,-,-,-,-,-,1,-,-)
 
+/*
+ * Both FARG and PUSH represent function arguments.  FARG is used in the
+ * early phase of analysis, when the node is not yet part of a function call
+ * expression (CALL or ICALL).  Later, build_function_argument builds a
+ * function call expression out of the FARG nodes, where they become PUSH.
+ * In a function call expression, the PUSH nodes are ordered from right to
+ * left, that is, the function call f(17, 23) is represented as
+ * CALL(f, PUSH(23, PUSH(17, NULL))).
+ */
+
 end_ops()
 
 #ifndef NOPS

Reply via email to