OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fb_info.cxx
Go to the documentation of this file.
1 /*
2 
3  Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
4 
5  This program is free software; you can redistribute it and/or modify it
6  under the terms of version 2 of the GNU General Public License as
7  published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it would be useful, but
10  WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13  Further, this software is distributed without any warranty that it is
14  free of the rightful claim of any third person regarding infringement
15  or the like. Any license provided herein, whether implied or
16  otherwise, applies only to this software file. Patent licenses, if
17  any, provided herein do not apply to combinations of this program with
18  other software, or any other product whatsoever.
19 
20  You should have received a copy of the GNU General Public License along
21  with this program; if not, write the Free Software Foundation, Inc., 59
22  Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 
24  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
25  Mountain View, CA 94043, or:
26 
27  http://www.sgi.com
28 
29  For further information regarding this notice, see:
30 
31  http://oss.sgi.com/projects/GenInfo/NoticeExplan
32 
33 */
34 
35 
36 //-*-c++-*-
37 // ====================================================================
38 // ====================================================================
39 //
40 //
41 // Description:
42 //
43 // The file fb_info.cxx defines the string array FB_EDGE_NAMES, and
44 // implements the procedures FB_EDGE_TYPE_fprintf and
45 // FB_EDGE_TYPE_sprintf.
46 //
47 // ====================================================================
48 // ====================================================================
49 
50 #include "fb_info.h"
51 
52 const char *FB_EDGE_NAMES[]
53  = { "------", "INCOMING", "OUTGOING", "ENTRY_OUTGOING",
54  "BRANCH_TAKEN", "BRANCH_NOT_TAKEN",
55  "LOOP_ZERO", "LOOP_POSITIVE", "LOOP_OUT", "LOOP_BACK",
56  "LOOP_EXIT", "LOOP_ITERATE",
57  "CIRCUIT_LEFT", "CIRCUIT_RIGHT", "CIRCUIT_NEITHER",
58  "CALL_INCOMING", "CALL_OUTGOING", "CALL_INOUTSAME",
59  "IO_OUTGOING", "IO_ESCAPE[1]", "IO_ESCAPE[2]", "IO_ESCAPE[3]",
60  "SWITCH_DEFAULT" };
61 
62 void
63 FB_EDGE_TYPE_fprintf( FILE *fp, const FB_EDGE_TYPE fb_type )\
64 {
65  if ( fb_type < FB_EDGE_SWITCH_BASE ) {
66  fprintf( fp, "%s", FB_EDGE_NAMES[fb_type] );
67  } else {
68  fprintf( fp, "SWITCH[%d]", fb_type - FB_EDGE_SWITCH_BASE );
69  }
70 }
71 
72 INT
73 FB_EDGE_TYPE_sprintf( char *buffer, const FB_EDGE_TYPE fb_type )
74 {
75  if ( fb_type < FB_EDGE_SWITCH_BASE ) {
76  return sprintf( buffer, "%s", FB_EDGE_NAMES[fb_type] );
77  } else {
78  return sprintf( buffer, "SWITCH[%d]", fb_type - FB_EDGE_SWITCH_BASE );
79  }
80 }