5 File name: ir/ana/pto_ctx.c
6 Purpose: Manage context-sensitivity markers
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.
22 pto_ctx: Manage context-sensitivity markers
26 # include "pto_debug.h"
27 # include "pto_comp.h"
31 /* # include "xmalloc.h" */
35 /* Local Data Types: */
37 /* Local Variables: */
38 static ctx_info_t *curr_ctx = NULL;
40 /* Local Prototypes: */
42 /* ===================================================
44 =================================================== */
47 /* ===================================================
48 Exported Implementation:
49 =================================================== */
50 /* Find the appropriate ctx for the given call and the given graph */
51 /* ctx_info_t *find_ctx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx) */
52 int find_ctx_idx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx)
55 const int n_ctxs = ginfo->n_ctxs;
57 for (i = 0; i < n_ctxs; i ++) {
58 ctx_info_t *ctx = ginfo->ctxs [i];
60 if ((ctx->enc == curr_ctx) && (ctx->call == call)) {
66 assert (0 && "CTX not found");
71 /* Get the current ctx */
72 ctx_info_t *get_curr_ctx (void)
77 /* Set the current ctx to the given ctx. Return the old value */
78 ctx_info_t *set_curr_ctx (ctx_info_t *ctx)
80 ctx_info_t *old_ctx = curr_ctx;
90 Revision 1.6 2005/12/05 12:19:54 beck
91 added missing include <assert.h> (not anymore included in libFirm)
93 Revision 1.5 2005/01/14 13:37:55 liekweg
96 Revision 1.4 2004/12/02 16:17:51 beck
97 fixed config.h include
99 Revision 1.3 2004/11/24 14:53:55 liekweg
102 Revision 1.2 2004/11/20 21:21:35 liekweg
105 Revision 1.1 2004/11/18 16:37:34 liekweg