X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FAnalysis%2FFindUsedTypes.h;h=b22cb88135133f2cd6b1bb0d40e66f3b29a860d4;hb=2905440bdd9627f202398137aab5ded38f681fc9;hp=de892f1b9cae0711588ad6c1d991d15bb39bb6ad;hpb=794fd75c67a2cdc128d67342c6d88a504d186896;p=oota-llvm.git diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h index de892f1b9ca..b22cb881351 100644 --- a/include/llvm/Analysis/FindUsedTypes.h +++ b/include/llvm/Analysis/FindUsedTypes.h @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -14,36 +14,38 @@ #ifndef LLVM_ANALYSIS_FINDUSEDTYPES_H #define LLVM_ANALYSIS_FINDUSEDTYPES_H +#include "llvm/ADT/SetVector.h" #include "llvm/Pass.h" -#include namespace llvm { class Type; +class Value; class FindUsedTypes : public ModulePass { - std::set UsedTypes; + SetVector UsedTypes; public: - static const int ID; // Pass identifcation, replacement for typeid - FindUsedTypes() : ModulePass((intptr_t)&ID) {} + static char ID; // Pass identification, replacement for typeid + FindUsedTypes() : ModulePass(ID) { + initializeFindUsedTypesPass(*PassRegistry::getPassRegistry()); + } /// getTypes - After the pass has been run, return the set containing all of /// the types used in the module. /// - const std::set &getTypes() const { return UsedTypes; } + const SetVector &getTypes() const { return UsedTypes; } /// Print the types found in the module. If the optional Module parameter is /// passed in, then the types are printed symbolically if possible, using the /// symbol table from the module. /// - void print(std::ostream &o, const Module *M) const; - void print(std::ostream *o, const Module *M) const { if (o) print(*o, M); } + void print(raw_ostream &o, const Module *M) const; private: /// IncorporateType - Incorporate one type and all of its subtypes into the /// collection of used types. /// - void IncorporateType(const Type *Ty); + void IncorporateType(Type *Ty); /// IncorporateValue - Incorporate all of the types used by this value. /// @@ -61,7 +63,4 @@ public: } // End llvm namespace -// Make sure that any clients of this file link in PostDominators.cpp -FORCE_DEFINING_FILE_TO_BE_LINKED(FindUsedTypes) - #endif