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.
20 pto_ctx: Manage context-sensitivity markers
24 # include "pto_debug.h"
25 # include "pto_comp.h"
29 /* # include "xmalloc.h" */
33 /* Local Data Types: */
35 /* Local Variables: */
36 static ctx_info_t *curr_ctx = NULL;
38 /* Local Prototypes: */
40 /* ===================================================
42 =================================================== */
45 /* ===================================================
46 Exported Implementation:
47 =================================================== */
48 /* Find the appropriate ctx for the given call and the given graph */
49 /* ctx_info_t *find_ctx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx) */
50 int find_ctx_idx (ir_node *call, graph_info_t *ginfo, ctx_info_t *curr_ctx)
53 const int n_ctxs = ginfo->n_ctxs;
55 for (i = 0; i < n_ctxs; i ++) {
56 ctx_info_t *ctx = ginfo->ctxs [i];
58 if ((ctx->enc == curr_ctx) && (ctx->call == call)) {
64 assert (0 && "CTX not found");
69 /* Get the current ctx */
70 ctx_info_t *get_curr_ctx (void)
75 /* Set the current ctx to the given ctx. Return the old value */
76 ctx_info_t *set_curr_ctx (ctx_info_t *ctx)
78 ctx_info_t *old_ctx = curr_ctx;
88 Revision 1.5 2005/01/14 13:37:55 liekweg
91 Revision 1.4 2004/12/02 16:17:51 beck
92 fixed config.h include
94 Revision 1.3 2004/11/24 14:53:55 liekweg
97 Revision 1.2 2004/11/20 21:21:35 liekweg
100 Revision 1.1 2004/11/18 16:37:34 liekweg