1 //===-- llvm/Analysis/Writer.h - Printer for Analysis routines ---*- C++ -*--=//
3 // This library provides routines to print out various analysis results to
6 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_ANALYSIS_WRITER_H
9 #define LLVM_ANALYSIS_WRITER_H
11 #include "llvm/Assembly/Writer.h"
15 // This library provides support for printing out Intervals.
17 class IntervalPartition;
19 void WriteToOutput(const Interval *I, std::ostream &o);
20 inline std::ostream &operator <<(std::ostream &o, const Interval *I) {
21 WriteToOutput(I, o); return o;
24 void WriteToOutput(const IntervalPartition &IP, std::ostream &o);
25 inline std::ostream &operator <<(std::ostream &o,
26 const IntervalPartition &IP) {
27 WriteToOutput(IP, o); return o;
30 // Stuff for printing out Dominator data structures...
32 class ImmediateDominators;
34 class DominanceFrontier;
36 void WriteToOutput(const DominatorSet &, std::ostream &o);
37 inline std::ostream &operator <<(std::ostream &o, const DominatorSet &DS) {
38 WriteToOutput(DS, o); return o;
41 void WriteToOutput(const ImmediateDominators &, std::ostream &o);
42 inline std::ostream &operator <<(std::ostream &o,
43 const ImmediateDominators &ID) {
44 WriteToOutput(ID, o); return o;
47 void WriteToOutput(const DominatorTree &, std::ostream &o);
48 inline std::ostream &operator <<(std::ostream &o, const DominatorTree &DT) {
49 WriteToOutput(DT, o); return o;
52 void WriteToOutput(const DominanceFrontier &, std::ostream &o);
53 inline std::ostream &operator <<(std::ostream &o,
54 const DominanceFrontier &DF) {
55 WriteToOutput(DF, o); return o;
58 // Stuff for printing out a callgraph...
62 void WriteToOutput(const CallGraph &, std::ostream &o);
63 inline std::ostream &operator <<(std::ostream &o, const CallGraph &CG) {
64 WriteToOutput(CG, o); return o;
67 void WriteToOutput(const CallGraphNode *, std::ostream &o);
68 inline std::ostream &operator <<(std::ostream &o, const CallGraphNode *CGN) {
69 WriteToOutput(CGN, o); return o;
72 // Stuff for printing out Loop information
76 void WriteToOutput(const LoopInfo &, std::ostream &o);
77 inline std::ostream &operator <<(std::ostream &o, const LoopInfo &LI) {
78 WriteToOutput(LI, o); return o;
81 void WriteToOutput(const Loop *, std::ostream &o);
82 inline std::ostream &operator <<(std::ostream &o, const Loop *L) {
83 WriteToOutput(L, o); return o;
86 } // End namespace CFG
88 class InductionVariable;
89 void WriteToOutput(const InductionVariable &, std::ostream &o);
90 inline std::ostream &operator <<(std::ostream &o, const InductionVariable &IV) {
91 WriteToOutput(IV, o); return o;