bedump.h 1.17 KB
Newer Older
Matthias Braun's avatar
Matthias Braun committed
1
2
/*
 * This file is part of libFirm.
3
 * Copyright (C) 2012 University of Karlsruhe.
Matthias Braun's avatar
Matthias Braun committed
4
5
6
7
8
9
10
11
12
13
14
15
 */

/**
 * @file
 * @brief       Code for dumping backend datastructures (i.e. interference graphs)
 * @author      Matthias Braun
 */
#ifndef FIRM_BE_BEDUMP_H
#define FIRM_BE_BEDUMP_H

#include <stdio.h>
#include <stdbool.h>
16
17

#include "bearch.h"
Matthias Braun's avatar
Matthias Braun committed
18
19
20
21
22
23
24
25
26
27
28
29
30

/**
 * Dump interference graph
 */
void be_dump_ifg(FILE *F, ir_graph *irg, const be_ifg_t *ifg);

/**
 * Dump interference graph with affinity edges as calculated by a
 * copy-minimisation phase
 */
void be_dump_ifg_co(FILE *F, const copy_opt_t *co,
                    bool dump_costs, bool dump_colors);

31
32
33
34
35
36
37
38
39
40
/**
 * Dump the liveness information for a graph.
 * @param f The output.
 * @param irg The graph.
 */
void be_liveness_dump(FILE *F, const be_lv_t *lv);

/**
 * node_info hook that dumps liveness for blocks
 */
Matthias Braun's avatar
Matthias Braun committed
41
void be_dump_liveness_block(be_lv_t *lv, FILE *F, const ir_node *block);
42

43
44
void be_dump_reqs_and_registers(FILE *F, const ir_node *node);

45
46
47
48
49
50
51
52
53
54
static inline char const *be_dump_reg_name(arch_register_t const *const reg)
{
	return reg ? reg->name : "n/a";
}

static inline char const *be_dump_yesno(bool const b)
{
	return b ? "yes" : "no";
}

Matthias Braun's avatar
Matthias Braun committed
55
#endif