Method.h no longer includes BasicBlock.h
[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, std::ostream &o);
20   inline std::ostream &operator <<(std::ostream &o, const Interval *I) {
21     WriteToOutput(I, o); return o;
22   }
23
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;
28   }
29
30   // Stuff for printing out Dominator data structures...
31   class DominatorSet;
32   class ImmediateDominators;
33   class DominatorTree;
34   class DominanceFrontier;
35
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;
39   }
40
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;
45   }
46
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;
50   }
51
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;
56   }
57
58   // Stuff for printing out a callgraph...
59   class CallGraph;
60   class CallGraphNode;
61
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;
65   }
66   
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;
70   }
71
72   // Stuff for printing out Loop information
73   class Loop;
74   class LoopInfo;
75
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;
79   }
80   
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;
84   }
85   
86 }  // End namespace CFG
87
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;
92 }
93
94
95 #endif