diff options
Diffstat (limited to 'src/statement.c')
-rw-r--r-- | src/statement.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c index 153e93be..ca924410 100644 --- a/src/statement.c +++ b/src/statement.c @@ -490,3 +490,26 @@ struct stmt *dup_stmt_alloc(const struct location *loc) { return stmt_alloc(loc, &dup_stmt_ops); } + +static void fwd_stmt_print(const struct stmt *stmt) +{ + printf("fwd to "); + expr_print(stmt->fwd.to); +} + +static void fwd_stmt_destroy(struct stmt *stmt) +{ + expr_free(stmt->fwd.to); +} + +static const struct stmt_ops fwd_stmt_ops = { + .type = STMT_FWD, + .name = "fwd", + .print = fwd_stmt_print, + .destroy = fwd_stmt_destroy, +}; + +struct stmt *fwd_stmt_alloc(const struct location *loc) +{ + return stmt_alloc(loc, &fwd_stmt_ops); +} |