summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorBen Morrow <ben@morrow.me.uk>2010-10-11 06:19:44 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-12 12:52:12 -0700
commit5983a79d5f38082aa0cba7c8ab4e8a4472979e59 (patch)
tree6b646ac29871abe42e5e98a68ae59e8c4c13a7f8 /op.h
parent2fcb4757c157c580cb9ddfcd3da7f1b3795d62a8 (diff)
downloadperl-5983a79d5f38082aa0cba7c8ab4e8a4472979e59.tar.gz
Add LINKLIST to the API.
Also rename the underlying function to op_linklist, to match the other API op functions.
Diffstat (limited to 'op.h')
-rw-r--r--op.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/op.h b/op.h
index 71bab3e3b3..5135ff0c24 100644
--- a/op.h
+++ b/op.h
@@ -622,6 +622,21 @@ struct loop {
#define ref(o, type) doref(o, type, TRUE)
#endif
+/*
+=head1 Optree Manipulation Functions
+
+=for apidoc Am|OP*|LINKLIST|OP *o
+Given the root of an optree, link the tree in execution order using the
+C<op_next> pointers and return the first op executed. If this has
+already been done, it will not be redone, and C<< o->op_next >> will be
+returned. If C<< o->op_next >> is not already set, I<o> should be at
+least an C<UNOP>.
+
+=cut
+*/
+
+#define LINKLIST(o) ((o)->op_next ? (o)->op_next : op_linklist((OP*)o))
+
/* no longer used anywhere in core */
#ifndef PERL_CORE
#define cv_ckproto(cv, gv, p) \