]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.*: more docstrings for compiler words
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 6 Aug 2014 14:39:29 +0000 (16:39 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 13 Aug 2014 18:01:11 +0000 (11:01 -0700)
basis/compiler/cfg/block-joining/block-joining-docs.factor [new file with mode: 0644]
basis/compiler/cfg/dataflow-analysis/dataflow-analysis-docs.factor
basis/compiler/cfg/linearization/linearization-docs.factor
basis/compiler/cfg/predecessors/predecessors-docs.factor [new file with mode: 0644]

diff --git a/basis/compiler/cfg/block-joining/block-joining-docs.factor b/basis/compiler/cfg/block-joining/block-joining-docs.factor
new file mode 100644 (file)
index 0000000..c16e6b4
--- /dev/null
@@ -0,0 +1,6 @@
+USING: compiler.cfg help.markup help.syntax ;
+IN: compiler.cfg.block-joining
+
+HELP: join-block?
+{ $values { "bb" basic-block } { "?" "a boolean" } }
+{ $description "Whether the block can be joined with its predecessor or not." } ;
index 645fb413ef7fec47518d5015cb9f040f1c0e600d..4f7081b4da936592a928d335fab0516f5767c880 100644 (file)
@@ -1,6 +1,33 @@
-USING: compiler.cfg help.markup help.syntax ;
+USING: classes compiler.cfg help.markup help.syntax sequences ;
 IN: compiler.cfg.dataflow-analysis
 
+HELP: predecessors
+{ $values { "bb" basic-block } { "dfa" "a dataflow analysis symbol" } { "seq" sequence } }
+{ $description "Generic word that returns the predecessors for a block. It's purpose is to facilitate backward analysis in which the blocks successors are seen as the predecessors." } ;
+
+HELP: successors
+{ $values { "bb" basic-block } { "dfa" "a dataflow analysis symbol" } { "seq" sequence } }
+{ $description "Generic word that returns the successors for a block. It's purpose is to facilitate backward analysis in which the blocks predecessors are seen as the successors." } ;
+
+HELP: transfer-set
+{ $values
+  { "in-set" "input state" }
+  { "bb" basic-block }
+  { "dfa" class }
+  { "out-set" "output state" }
+}
+{ $description "Generic word which is called during the dataflow analysis to process each basic block in the cfg. It is supposed to be implemented by all forward and backward dataflow analysis subclasses to perform analysis." } ;
+
+HELP: join-sets
+{ $values
+  { "sets" "input states" }
+  { "bb" basic-block }
+  { "dfa" class }
+  { "set" "merged state" }
+}
+{ $description "Generic word which merges multiple states into one. A block in the cfg might have multiple predecessors and then this word is used to compute the merged input state to use to analyze the block." } ;
+
+
 <PRIVATE
 
 HELP: run-dataflow-analysis
index 4d42594b99ca8e763f8016a87e6810476eee8d20..934a574978989e1d71dd823b18601a4be498d34f 100644 (file)
@@ -1,5 +1,5 @@
 USING: compiler.cfg compiler.cfg.linearization compiler.codegen help.markup
-help.syntax kernel macros sequences ;
+help.syntax kernel macros math sequences ;
 IN: compiler.cfg.linearization
 
 HELP: linearization-order
@@ -9,3 +9,11 @@ HELP: linearization-order
 }
 { $description "Lists the basic blocks in linearization order. That is, the order in which they will be written in the generated assembly code." }
 { $see-also generate } ;
+
+HELP: block-number
+{ $values { "bb" basic-block } { "n" integer } }
+{ $description "Retrieves this blocks block number. Must not be called before " { $link number-blocks } "." } ;
+
+HELP: number-blocks
+{ $values { "bbs" sequence } }
+{ $description "Associate each block with a block number and save the result in the " { $link numbers } " map." } ;
diff --git a/basis/compiler/cfg/predecessors/predecessors-docs.factor b/basis/compiler/cfg/predecessors/predecessors-docs.factor
new file mode 100644 (file)
index 0000000..1977d72
--- /dev/null
@@ -0,0 +1,6 @@
+USING: compiler.cfg help.markup help.syntax kernel ;
+IN: compiler.cfg.predecessors
+
+HELP: needs-predecessors
+{ $values { "cfg" cfg } { "cfg'" cfg } }
+{ $description "Computes predecessor info for the cfg unless it already is up-to-date." } ;