projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set ls_mode for created ia32_Test node.
[libfirm]
/
ir
/
stat
/
pattern_dmp.c
diff --git
a/ir/stat/pattern_dmp.c
b/ir/stat/pattern_dmp.c
index
ef7136a
..
c3958a6
100644
(file)
--- a/
ir/stat/pattern_dmp.c
+++ b/
ir/stat/pattern_dmp.c
@@
-25,8
+25,6
@@
*/
#include "config.h"
*/
#include "config.h"
-#ifdef FIRM_STATISTICS
-
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
@@
-50,7
+48,7
@@
typedef void (*DUMP_END_FUNC)(pattern_dumper_t *self);
/**
* the pattern dumper
*/
/**
* the pattern dumper
*/
-struct
_
pattern_dumper_t {
+struct pattern_dumper_t {
DUMP_NEW_PATTERN_FUNC dump_new_pattern;
DUMP_FINISH_PATTERN_FUNC dump_finish_pattern;
DUMP_NODE_FUNC dump_node;
DUMP_NEW_PATTERN_FUNC dump_new_pattern;
DUMP_FINISH_PATTERN_FUNC dump_finish_pattern;
DUMP_NODE_FUNC dump_node;
@@
-66,7
+64,7
@@
struct _pattern_dumper_t {
/**
* VCG private data
*/
/**
* VCG private data
*/
-typedef struct
_
vcg_private_t {
+typedef struct vcg_private_t {
FILE *f; /**< file to dump to */
unsigned pattern_id; /**< ID of the pattern */
unsigned max_pattern; /**< maximum number of pattern to be dumped */
FILE *f; /**< file to dump to */
unsigned pattern_id; /**< ID of the pattern */
unsigned max_pattern; /**< maximum number of pattern to be dumped */
@@
-77,7
+75,7
@@
typedef struct _vcg_private_t {
*/
static void vcg_dump_start(pattern_dumper_t *self)
{
*/
static void vcg_dump_start(pattern_dumper_t *self)
{
- vcg_private_t *priv = self->data;
+ vcg_private_t *priv =
(vcg_private_t*)
self->data;
fprintf(priv->f,
"graph: { title: \"Most found pattern\"\n"
fprintf(priv->f,
"graph: { title: \"Most found pattern\"\n"
@@
-94,7
+92,7
@@
static void vcg_dump_start(pattern_dumper_t *self)
*/
static void vcg_dump_end(pattern_dumper_t *self)
{
*/
static void vcg_dump_end(pattern_dumper_t *self)
{
- vcg_private_t *priv = self->data;
+ vcg_private_t *priv =
(vcg_private_t*)
self->data;
fprintf(priv->f, "}\n");
fclose(priv->f);
fprintf(priv->f, "}\n");
fclose(priv->f);
@@
-105,7
+103,7
@@
static void vcg_dump_end(pattern_dumper_t *self)
*/
static void vcg_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt)
{
*/
static void vcg_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt)
{
- vcg_private_t *priv = self->data;
+ vcg_private_t *priv =
(vcg_private_t*)
self->data;
static unsigned nr = 0;
if (priv->pattern_id > priv->max_pattern)
static unsigned nr = 0;
if (priv->pattern_id > priv->max_pattern)
@@
-127,7
+125,7
@@
static void vcg_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt)
*/
static void vcg_dump_finish_pattern(pattern_dumper_t *self)
{
*/
static void vcg_dump_finish_pattern(pattern_dumper_t *self)
{
- vcg_private_t *priv = self->data;
+ vcg_private_t *priv =
(vcg_private_t*)
self->data;
if (priv->pattern_id > priv->max_pattern)
return;
if (priv->pattern_id > priv->max_pattern)
return;
@@
-148,9
+146,9
@@
static void vcg_dump_finish_pattern(pattern_dumper_t *self)
static void vcg_dump_node(pattern_dumper_t *self, unsigned id,
unsigned op_code, unsigned mode_code, void *attr)
{
static void vcg_dump_node(pattern_dumper_t *self, unsigned id,
unsigned op_code, unsigned mode_code, void *attr)
{
- vcg_private_t *priv = self->data;
+ vcg_private_t *priv =
(vcg_private_t*)
self->data;
ir_op *op = stat_get_op_from_opcode(op_code);
ir_op *op = stat_get_op_from_opcode(op_code);
- ir_mode *mode =
stat_mode_for_index
(mode_code);
+ ir_mode *mode =
get_irp_mode
(mode_code);
long l = attr ? *(long *)attr : 0;
if (priv->pattern_id > priv->max_pattern)
long l = attr ? *(long *)attr : 0;
if (priv->pattern_id > priv->max_pattern)
@@
-170,7
+168,7
@@
static void vcg_dump_node(pattern_dumper_t *self, unsigned id,
*/
static void vcg_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code)
{
*/
static void vcg_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code)
{
- vcg_private_t *priv = self->data;
+ vcg_private_t *priv =
(vcg_private_t*)
self->data;
(void) mode_code;
if (priv->pattern_id > priv->max_pattern)
(void) mode_code;
if (priv->pattern_id > priv->max_pattern)
@@
-204,7
+202,7
@@
static pattern_dumper_t vcg_dump = {
*/
static void stdout_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt)
{
*/
static void stdout_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt)
{
- FILE *f = self->data;
+ FILE *f =
(FILE*)
self->data;
fprintf(f, "%8u ", cnt_to_uint(cnt));
} /* stdout_dump_new_pattern */
fprintf(f, "%8u ", cnt_to_uint(cnt));
} /* stdout_dump_new_pattern */
@@
-215,7
+213,7
@@
static void stdout_dump_new_pattern(pattern_dumper_t *self, counter_t *cnt)
*/
static void stdout_dump_finish_pattern(pattern_dumper_t *self)
{
*/
static void stdout_dump_finish_pattern(pattern_dumper_t *self)
{
- FILE *f = self->data;
+ FILE *f =
(FILE*)
self->data;
fprintf(f, "\n");
} /* stdout_dump_finish_pattern */
fprintf(f, "\n");
} /* stdout_dump_finish_pattern */
@@
-225,9
+223,9
@@
static void stdout_dump_finish_pattern(pattern_dumper_t *self)
*/
static void stdout_dump_node(pattern_dumper_t *self, unsigned id, unsigned op_code, unsigned mode_code, void *attr)
{
*/
static void stdout_dump_node(pattern_dumper_t *self, unsigned id, unsigned op_code, unsigned mode_code, void *attr)
{
- FILE *f = self->data;
+ FILE *f =
(FILE*)
self->data;
ir_op *op = stat_get_op_from_opcode(op_code);
ir_op *op = stat_get_op_from_opcode(op_code);
- ir_mode *mode =
stat_mode_for_index
(mode_code);
+ ir_mode *mode =
get_irp_mode
(mode_code);
(void) attr;
/* if (env->options & OPT_ENC_GRAPH) */
(void) attr;
/* if (env->options & OPT_ENC_GRAPH) */
@@
-244,7
+242,7
@@
static void stdout_dump_node(pattern_dumper_t *self, unsigned id, unsigned op_co
*/
static void stdout_dump_ref(pattern_dumper_t *self, unsigned id)
{
*/
static void stdout_dump_ref(pattern_dumper_t *self, unsigned id)
{
- FILE *f = self->data;
+ FILE *f =
(FILE*)
self->data;
fprintf(f, "REF:%u", id);
} /* stdout_dump_ref */
fprintf(f, "REF:%u", id);
} /* stdout_dump_ref */
@@
-254,7
+252,7
@@
static void stdout_dump_ref(pattern_dumper_t *self, unsigned id)
*/
static void stdout_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code)
{
*/
static void stdout_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src, unsigned pos, unsigned mode_code)
{
- FILE *f = self->data;
+ FILE *f =
(FILE*)
self->data;
(void) tgt;
(void) src;
(void) pos;
(void) tgt;
(void) src;
(void) pos;
@@
-269,7
+267,7
@@
static void stdout_dump_edge(pattern_dumper_t *self, unsigned tgt, unsigned src,
*/
static void stdout_start_children(pattern_dumper_t *self, unsigned id)
{
*/
static void stdout_start_children(pattern_dumper_t *self, unsigned id)
{
- FILE *f = self->data;
+ FILE *f =
(FILE*)
self->data;
(void) id;
fprintf(f, "(");
(void) id;
fprintf(f, "(");
@@
-280,7
+278,7
@@
static void stdout_start_children(pattern_dumper_t *self, unsigned id)
*/
static void stdout_finish_children(pattern_dumper_t *self, unsigned id)
{
*/
static void stdout_finish_children(pattern_dumper_t *self, unsigned id)
{
- FILE *f = self->data;
+ FILE *f =
(FILE*)
self->data;
(void) id;
fprintf(f, ")");
(void) id;
fprintf(f, ")");
@@
-385,15
+383,13
@@
void pattern_end(pattern_dumper_t *self)
*/
pattern_dumper_t *new_text_dumper(void)
{
*/
pattern_dumper_t *new_text_dumper(void)
{
- pattern_dumper_t *res =
malloc(sizeof(*res)
);
+ pattern_dumper_t *res =
XMALLOC(pattern_dumper_t
);
- if (res) {
- memcpy(res, &stdout_dump, sizeof(*res));
- res->data = stdout;
+ *res = stdout_dump;
+ res->data = stdout;
- if (res->dump_start)
- res->dump_start(res);
- } /* if */
+ if (res->dump_start)
+ res->dump_start(res);
return res;
} /* new_text_dumper */
return res;
} /* new_text_dumper */
@@
-402,7
+398,7
@@
pattern_dumper_t *new_text_dumper(void)
*/
pattern_dumper_t *new_vcg_dumper(const char *vcg_name, unsigned max_pattern)
{
*/
pattern_dumper_t *new_vcg_dumper(const char *vcg_name, unsigned max_pattern)
{
- pattern_dumper_t *res = malloc(sizeof(*res) + sizeof(vcg_private_t));
+ pattern_dumper_t *res =
(pattern_dumper_t*)
malloc(sizeof(*res) + sizeof(vcg_private_t));
vcg_private_t *priv;
if (res) {
vcg_private_t *priv;
if (res) {
@@
-425,5
+421,3
@@
pattern_dumper_t *new_vcg_dumper(const char *vcg_name, unsigned max_pattern)
return res;
} /* new_vcg_dumper */
return res;
} /* new_vcg_dumper */
-
-#endif /* FIRM_STATISTICS */