Standardize header file comments
[oota-llvm.git] / include / llvm / Analysis / FindUsedTypes.h
1 //===- llvm/Analysis/FindUsedTypes.h - Find all Types in use ----*- C++ -*-===//
2 //
3 // This pass is used to seek out all of the types in use by the program.
4 //
5 //===----------------------------------------------------------------------===//
6
7 #ifndef LLVM_ANALYSIS_FINDUSEDTYPES_H
8 #define LLVM_ANALYSIS_FINDUSEDTYPES_H
9
10 #include "llvm/Pass.h"
11 #include <set>
12 class SymbolTable;
13 class Type;
14
15 class FindUsedTypes : public Pass {
16   std::set<const Type *> UsedTypes;
17 public:
18   /// getTypes - After the pass has been run, return the set containing all of
19   /// the types used in the module.
20   ///
21   const std::set<const Type *> &getTypes() const { return UsedTypes; }
22
23   /// Print the types found in the module.  If the optional Module parameter is
24   /// passed in, then the types are printed symbolically if possible, using the
25   /// symbol table from the module.
26   ///
27   void print(std::ostream &o, const Module *M) const;
28
29 private:
30   /// IncorporateType - Incorporate one type and all of its subtypes into the
31   /// collection of used types.
32   ///
33   void IncorporateType(const Type *Ty);
34
35 public:
36   /// run - This incorporates all types used by the specified module
37   bool run(Module &M);
38
39   /// getAnalysisUsage - We do not modify anything.
40   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
41     AU.setPreservesAll();
42   }
43
44   // stub - dummy function, just ignore it
45   static void stub();
46 };
47
48 // Make sure that any clients of this file link in PostDominators.cpp
49 static IncludeFile
50 FIND_USED_TYPES_INCLUDE_FILE((void*)&FindUsedTypes::stub);
51
52 #endif