5 File name: ir/ana/pto_ctx.c
9 Created: Sat Nov 13 19:35:27 CET 2004
11 Copyright: (c) 1999-2004 Universität Karlsruhe
12 Licence: This file is protected by the GPL - GNU GENERAL PUBLIC LICENSE.
28 # include "pto_debug.h"
32 /* Local Data Types: */
34 /* Local Variables: */
35 static ctx_info_t *curr_ctx = NULL;
37 /* Local Prototypes: */
39 /* ===================================================
41 =================================================== */
44 /* ===================================================
45 Exported Implementation:
46 =================================================== */
47 /* Find the appropriate ctx for the given call and the given graph */
48 /* ctx_info_t *find_ctx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx) */
49 int find_ctx_idx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx)
52 const int n_ctxs = ginfo->n_ctxs;
54 for (i = 0; i < n_ctxs; i ++) {
55 ctx_info_t *ctx = ginfo->ctxs [i];
57 if ((ctx->enc == curr_ctx) && (ctx->call == call)) {
63 assert (0 && "CTX not found");
68 /* Get the current ctx */
69 ctx_info_t *get_curr_ctx (void)
74 /* Set the current ctx to the given ctx. Return the old value */
75 ctx_info_t *set_curr_ctx (ctx_info_t *ctx)
77 ctx_info_t *old_ctx = curr_ctx;
89 Revision 1.1 2004/11/18 16:37:34 liekweg