Add writer support for call graph nodes and loops and induction variables
[oota-llvm.git] / include / llvm / Analysis / Writer.h
1 //===-- llvm/Analysis/Writer.h - Printer for Analysis routines ---*- C++ -*--=//
2 //
3 // This library provides routines to print out various analysis results to 
4 // an output stream.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #ifndef LLVM_ANALYSIS_WRITER_H
9 #define LLVM_ANALYSIS_WRITER_H
10
11 #include "llvm/Assembly/Writer.h"
12
13 namespace cfg {
14
15   // This library provides support for printing out Intervals.
16   class Interval;
17   class IntervalPartition;
18
19   void WriteToOutput(const Interval *I, ostream &o);
20   inline ostream &operator <<(ostream &o, const Interval *I) {
21     WriteToOutput(I, o); return o;
22   }
23
24   void WriteToOutput(const IntervalPartition &IP, ostream &o);
25   inline ostream &operator <<(ostream &o, const IntervalPartition &IP) {
26     WriteToOutput(IP, o); return o;
27   }
28
29   // Stuff for printing out Dominator data structures...
30   class DominatorSet;
31   class ImmediateDominators;
32   class DominatorTree;
33   class DominanceFrontier;
34
35   void WriteToOutput(const DominatorSet &, ostream &o);
36   inline ostream &operator <<(ostream &o, const DominatorSet &DS) {
37     WriteToOutput(DS, o); return o;
38   }
39
40   void WriteToOutput(const ImmediateDominators &, ostream &o);
41   inline ostream &operator <<(ostream &o, const ImmediateDominators &ID) {
42     WriteToOutput(ID, o); return o;
43   }
44
45   void WriteToOutput(const DominatorTree &, ostream &o);
46   inline ostream &operator <<(ostream &o, const DominatorTree &DT) {
47     WriteToOutput(DT, o); return o;
48   }
49
50   void WriteToOutput(const DominanceFrontier &, ostream &o);
51   inline ostream &operator <<(ostream &o, const DominanceFrontier &DF) {
52     WriteToOutput(DF, o); return o;
53   }
54
55   // Stuff for printing out a callgraph...
56   class CallGraph;
57   class CallGraphNode;
58
59   void WriteToOutput(const CallGraph &, ostream &o);
60   inline ostream &operator <<(ostream &o, const CallGraph &CG) {
61     WriteToOutput(CG, o); return o;
62   }
63   
64   void WriteToOutput(const CallGraphNode *, ostream &o);
65   inline ostream &operator <<(ostream &o, const CallGraphNode *CGN) {
66     WriteToOutput(CGN, o); return o;
67   }
68
69   // Stuff for printing out Loop information
70   class Loop;
71   class LoopInfo;
72
73   void WriteToOutput(const LoopInfo &, ostream &o);
74   inline ostream &operator <<(ostream &o, const LoopInfo &LI) {
75     WriteToOutput(LI, o); return o;
76   }
77   
78   void WriteToOutput(const Loop *, ostream &o);
79   inline ostream &operator <<(ostream &o, const Loop *L) {
80     WriteToOutput(L, o); return o;
81   }
82   
83 }  // End namespace CFG
84
85 class InductionVariable;
86 void WriteToOutput(const InductionVariable &, ostream &o);
87 inline ostream &operator <<(ostream &o, const InductionVariable &IV) {
88   WriteToOutput(IV, o); return o;
89 }
90
91
92 #endif