Jlm
Loading...
Searching...
No Matches
print.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2017 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#ifndef JLM_JLM_LLVM_IR_PRINT_HPP
7#define JLM_JLM_LLVM_IR_PRINT_HPP
8
9/* FIXME: I would rather like to forward declare AnnotationMap and demand_set */
12
13#include <string>
14
15namespace jlm::llvm
16{
17
18class InterProceduralGraph;
19class InterProceduralGraphModule;
20
21/* inter-procedural graph */
22
23std::string
24to_str(const InterProceduralGraph & ipg);
25
26static inline void
27print_ascii(const InterProceduralGraph & ipg, FILE * out)
28{
29 fputs(to_str(ipg).c_str(), out);
30 fflush(out);
31}
32
33/* ipgraph module */
34
35static inline std::string
37{
38 return to_str(im.ipgraph());
39}
40
41static inline void
42print(const InterProceduralGraphModule & im, FILE * out)
43{
44 fputs(to_str(im).c_str(), out);
45 fflush(out);
46}
47
48/* aggregation tree */
49
50std::string
51to_str(const AggregationNode & n, const AnnotationMap & dm);
52
53static inline std::string
55{
56 return to_str(n, {});
57}
58
59void
60print(const AggregationNode & n, const AnnotationMap & dm, FILE * out);
61
62static inline void
63print(const AggregationNode & n, FILE * out)
64{
65 print(n, {}, out);
66}
67
68}
69
70#endif
InterProceduralGraph & ipgraph() noexcept
Global memory state passed between functions.
static void print_ascii(const InterProceduralGraph &ipg, FILE *out)
Definition print.hpp:27
void print(const AggregationNode &n, const AnnotationMap &dm, FILE *out)
Definition print.cpp:120
std::string to_str(const InterProceduralGraph &clg)
Definition print.cpp:79