diff options
author | Chris Lattner <sabre@nondot.org> | 2002-01-31 00:45:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-01-31 00:45:11 +0000 |
commit | 793c6b80d3e322c3fefb3c7314b054c7880d1691 (patch) | |
tree | c2d24f4cc875a6e1bf9bf3b3227464448850666f /lib/Transforms/IPO/DeadTypeElimination.cpp | |
parent | 9c9be48b8396e7244e47d2af8890da8eec71c72d (diff) | |
download | llvm-793c6b80d3e322c3fefb3c7314b054c7880d1691.tar.gz llvm-793c6b80d3e322c3fefb3c7314b054c7880d1691.tar.bz2 llvm-793c6b80d3e322c3fefb3c7314b054c7880d1691.tar.xz |
Convert xforms over to new pass structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/DeadTypeElimination.cpp')
-rw-r--r-- | lib/Transforms/IPO/DeadTypeElimination.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp index c170e15164..297eaddfba 100644 --- a/lib/Transforms/IPO/DeadTypeElimination.cpp +++ b/lib/Transforms/IPO/DeadTypeElimination.cpp @@ -13,7 +13,9 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/CleanupGCCOutput.h" +#include "llvm/Analysis/FindUsedTypes.h" #include "TransformInternals.h" +#include "llvm/Module.h" #include "llvm/SymbolTable.h" #include "llvm/DerivedTypes.h" #include "llvm/iPHINode.h" @@ -225,8 +227,6 @@ static inline bool ShouldNukeSymtabEntry(const std::pair<string, Value*> &E) { bool CleanupGCCOutput::doInitialization(Module *M) { bool Changed = false; - FUT.doInitialization(M); - if (PtrSByte == 0) PtrSByte = PointerType::get(Type::SByteTy); @@ -491,19 +491,17 @@ static bool fixLocalProblems(Method *M) { // doPerMethodWork - This method simplifies the specified method hopefully. // bool CleanupGCCOutput::runOnMethod(Method *M) { - bool Changed = fixLocalProblems(M); - - FUT.runOnMethod(M); - return Changed; + return fixLocalProblems(M); } bool CleanupGCCOutput::doFinalization(Module *M) { bool Changed = false; - FUT.doFinalization(M); + if (M->hasSymbolTable()) { SymbolTable *ST = M->getSymbolTable(); - const std::set<const Type *> &UsedTypes = FUT.getTypes(); + const std::set<const Type *> &UsedTypes = + getAnalysis<FindUsedTypes>().getTypes(); // Check the symbol table for superfluous type entries that aren't used in // the program @@ -529,3 +527,13 @@ bool CleanupGCCOutput::doFinalization(Module *M) { } return Changed; } + +// getAnalysisUsageInfo - This function needs the results of the +// FindUsedTypes and FindUnsafePointerTypes analysis passes... +// +void CleanupGCCOutput::getAnalysisUsageInfo(Pass::AnalysisSet &Required, + Pass::AnalysisSet &Destroyed, + Pass::AnalysisSet &Provided) { + // FIXME: Invalidates the CFG + Required.push_back(FindUsedTypes::ID); +} |