aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-10-01 05:42:50 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-10-01 05:42:50 +0000
commit26e5d47d44df43aaa6a14ae56bc057913c1d3e4c (patch)
tree5a7cdb25526c71c4ba40e1f830effe2aeab5a9dc /gcc/tree-cfg.c
parentaeecd3d21279c5d524b3310b7f02ee83878c3cbe (diff)
downloadgcc-26e5d47d44df43aaa6a14ae56bc057913c1d3e4c.zip
gcc-26e5d47d44df43aaa6a14ae56bc057913c1d3e4c.tar.gz
gcc-26e5d47d44df43aaa6a14ae56bc057913c1d3e4c.tar.bz2
Make dumping of function attributes resemble source syntax
2015-10-01 Tom de Vries <tom@codesourcery.com> * tree-cfg.c (dump_function_to_file): Dump function attributes using __attribute__(()) string. Move dumping of function attributes to before function name. From-SVN: r228315
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index e06ee28..735ac46 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-cfgcleanup.h"
#include "wide-int-print.h"
#include "gimplify.h"
+#include "attribs.h"
/* This file contains functions for building the Control Flow Graph (CFG)
for a function tree. */
@@ -7352,6 +7353,30 @@ dump_function_to_file (tree fndecl, FILE *file, int flags)
&& decl_is_tm_clone (fndecl));
struct function *fun = DECL_STRUCT_FUNCTION (fndecl);
+ if (DECL_ATTRIBUTES (fndecl) != NULL_TREE)
+ {
+ fprintf (file, "__attribute__((");
+
+ bool first = true;
+ tree chain;
+ for (chain = DECL_ATTRIBUTES (fndecl); chain;
+ first = false, chain = TREE_CHAIN (chain))
+ {
+ if (!first)
+ fprintf (file, ", ");
+
+ print_generic_expr (file, get_attribute_name (chain), dump_flags);
+ if (TREE_VALUE (chain) != NULL_TREE)
+ {
+ fprintf (file, " (");
+ print_generic_expr (file, TREE_VALUE (chain), dump_flags);
+ fprintf (file, ")");
+ }
+ }
+
+ fprintf (file, "))\n");
+ }
+
current_function_decl = fndecl;
fprintf (file, "%s %s(", function_name (fun), tmclone ? "[tm-clone] " : "");
@@ -7369,13 +7394,6 @@ dump_function_to_file (tree fndecl, FILE *file, int flags)
}
fprintf (file, ")\n");
- if (DECL_ATTRIBUTES (fndecl) != NULL_TREE)
- {
- fprintf (file, "[ ");
- print_generic_expr (file, DECL_ATTRIBUTES (fndecl), dump_flags);
- fprintf (file, "]\n");
- }
-
if (flags & TDF_VERBOSE)
print_node (file, "", fndecl, 2);