00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef LLVM_ANALYSIS_FINDUSEDTYPES_H
00015 #define LLVM_ANALYSIS_FINDUSEDTYPES_H
00016
00017 #include "llvm/Pass.h"
00018 #include <set>
00019
00020 namespace llvm {
00021
00022 class Type;
00023 class Value;
00024
00025 class FindUsedTypes : public ModulePass {
00026 std::set<const Type *> UsedTypes;
00027 public:
00028 static char ID;
00029 FindUsedTypes() : ModulePass(&ID) {}
00030
00034 const std::set<const Type *> &getTypes() const { return UsedTypes; }
00035
00040 void print(raw_ostream &o, const Module *M) const;
00041
00042 private:
00046 void IncorporateType(const Type *Ty);
00047
00050 void IncorporateValue(const Value *V);
00051
00052 public:
00054 bool runOnModule(Module &M);
00055
00057 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
00058 AU.setPreservesAll();
00059 }
00060 };
00061
00062 }
00063
00064 #endif