From a2af8e216fc14e59f636521417ac6ed941f58154 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 26 Jun 2013 09:03:51 +0000 Subject: an optimization in the jitter for generating more compact code --- src/runtime/c/pgf/reasoner.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/runtime/c/pgf/reasoner.c') diff --git a/src/runtime/c/pgf/reasoner.c b/src/runtime/c/pgf/reasoner.c index 3e5c64692..179933e91 100644 --- a/src/runtime/c/pgf/reasoner.c +++ b/src/runtime/c/pgf/reasoner.c @@ -40,7 +40,7 @@ struct PgfExprState { typedef struct { // base must be the first field in order to be able to cast - // from PgfCombine2State to PgfReasonerState + // from PgfCombine1State to PgfReasonerState PgfReasonerState base; GuBuf* exprs; PgfExprState* parent; @@ -331,6 +331,13 @@ pgf_complete(PgfReasoner* rs, PgfExprState* st) nst->base.continuation(rs, &nst->base); } +void +pgf_try_constant(PgfReasoner* rs, PgfExprState* prev, PgfAbsFun* absfun) +{ + pgf_try_else(rs, prev, absfun); + pgf_complete(rs, prev); +} + static PgfExprProb* pgf_reasoner_next(PgfReasoner* rs) { -- cgit v1.2.3