Mercurial > hg > CbC > CbC_gcc
comparison gcc/graph.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* Output routines for graphical representation. | 1 /* Output routines for graphical representation. |
2 Copyright (C) 1998-2018 Free Software Foundation, Inc. | 2 Copyright (C) 1998-2020 Free Software Foundation, Inc. |
3 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. | 3 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. |
4 Rewritten for DOT output by Steven Bosscher, 2012. | 4 Rewritten for DOT output by Steven Bosscher, 2012. |
5 | 5 |
6 This file is part of GCC. | 6 This file is part of GCC. |
7 | 7 |
50 memcpy (buf, base, namelen); | 50 memcpy (buf, base, namelen); |
51 memcpy (buf + namelen, graph_ext, extlen); | 51 memcpy (buf + namelen, graph_ext, extlen); |
52 | 52 |
53 fp = fopen (buf, mode); | 53 fp = fopen (buf, mode); |
54 if (fp == NULL) | 54 if (fp == NULL) |
55 fatal_error (input_location, "can%'t open %s: %m", buf); | 55 fatal_error (input_location, "cannot open %s: %m", buf); |
56 | 56 |
57 return fp; | 57 return fp; |
58 } | 58 } |
59 | |
60 /* Disable warnings about quoting issues in the pp_xxx calls below | |
61 that (intentionally) don't follow GCC diagnostic conventions. */ | |
62 #if __GNUC__ >= 10 | |
63 # pragma GCC diagnostic push | |
64 # pragma GCC diagnostic ignored "-Wformat-diag" | |
65 #endif | |
59 | 66 |
60 /* Draw a basic block BB belonging to the function with FUNCDEF_NO | 67 /* Draw a basic block BB belonging to the function with FUNCDEF_NO |
61 as its unique number. */ | 68 as its unique number. */ |
62 static void | 69 static void |
63 draw_cfg_node (pretty_printer *pp, int funcdef_no, basic_block bb) | 70 draw_cfg_node (pretty_printer *pp, int funcdef_no, basic_block bb) |
188 order to get a good ranking of the nodes. This function is recursive: | 195 order to get a good ranking of the nodes. This function is recursive: |
189 It first prints inner loops, then the body of LOOP itself. */ | 196 It first prints inner loops, then the body of LOOP itself. */ |
190 | 197 |
191 static void | 198 static void |
192 draw_cfg_nodes_for_loop (pretty_printer *pp, int funcdef_no, | 199 draw_cfg_nodes_for_loop (pretty_printer *pp, int funcdef_no, |
193 struct loop *loop) | 200 class loop *loop) |
194 { | 201 { |
195 basic_block *body; | 202 basic_block *body; |
196 unsigned int i; | 203 unsigned int i; |
197 const char *fillcolors[3] = { "grey88", "grey77", "grey66" }; | 204 const char *fillcolors[3] = { "grey88", "grey77", "grey66" }; |
198 | 205 |
208 "\tpenwidth=2;\n", | 215 "\tpenwidth=2;\n", |
209 funcdef_no, loop->num, | 216 funcdef_no, loop->num, |
210 fillcolors[(loop_depth (loop) - 1) % 3], | 217 fillcolors[(loop_depth (loop) - 1) % 3], |
211 loop->num); | 218 loop->num); |
212 | 219 |
213 for (struct loop *inner = loop->inner; inner; inner = inner->next) | 220 for (class loop *inner = loop->inner; inner; inner = inner->next) |
214 draw_cfg_nodes_for_loop (pp, funcdef_no, inner); | 221 draw_cfg_nodes_for_loop (pp, funcdef_no, inner); |
215 | 222 |
216 if (loop->header == NULL) | 223 if (loop->header == NULL) |
217 return; | 224 return; |
218 | 225 |
379 { | 386 { |
380 FILE *fp = open_graph_file (base, "a"); | 387 FILE *fp = open_graph_file (base, "a"); |
381 end_graph_dump (fp); | 388 end_graph_dump (fp); |
382 fclose (fp); | 389 fclose (fp); |
383 } | 390 } |
391 | |
392 #if __GNUC__ >= 10 | |
393 # pragma GCC diagnostic pop | |
394 #endif |