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/SimpleStructMutation.cpp | |
parent | 9c9be48b8396e7244e47d2af8890da8eec71c72d (diff) |
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/SimpleStructMutation.cpp')
-rw-r--r-- | lib/Transforms/IPO/SimpleStructMutation.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/Transforms/IPO/SimpleStructMutation.cpp b/lib/Transforms/IPO/SimpleStructMutation.cpp index 7e28af3df3..8583e3e850 100644 --- a/lib/Transforms/IPO/SimpleStructMutation.cpp +++ b/lib/Transforms/IPO/SimpleStructMutation.cpp @@ -89,24 +89,16 @@ static inline void GetTransformation(const StructType *ST, SimpleStructMutation::TransformsType SimpleStructMutation::getTransforms(Module *M, enum Transform XForm) { - - // FIXME: These should be calculated by the Pass framework! - // We need to know which types to modify, and which types we CAN'T modify - FindUsedTypes *FUT = new FindUsedTypes(/*true*/); // TODO: Do symbol tables as well - FindUnsafePointerTypes *FUPT = new FindUnsafePointerTypes(); - - // Simutaneously find all of the types used, and all of the types that aren't - // safe. - // - PassManager Analyses; - Analyses.add(FUT); - Analyses.add(FUPT); - Analyses.run(M); // Do analyses + // TODO: Do symbol tables as well // Get the results out of the analyzers... - const set<PointerType*> &UnsafePTys = FUPT->getUnsafeTypes(); - const set<const Type *> &UsedTypes = FUT->getTypes(); + FindUsedTypes &FUT = getAnalysis<FindUsedTypes>(); + const set<const Type *> &UsedTypes = FUT.getTypes(); + + FindUnsafePointerTypes &FUPT = getAnalysis<FindUnsafePointerTypes>(); + const set<PointerType*> &UnsafePTys = FUPT.getUnsafeTypes(); + // Combine the two sets, weeding out non structure types. Closures in C++ @@ -144,3 +136,14 @@ SimpleStructMutation::TransformsType return Transforms; } + +// getAnalysisUsageInfo - This function needs the results of the +// FindUsedTypes and FindUnsafePointerTypes analysis passes... +// +void SimpleStructMutation::getAnalysisUsageInfo(Pass::AnalysisSet &Required, + Pass::AnalysisSet &Destroyed, + Pass::AnalysisSet &Provided){ + Required.push_back(FindUsedTypes::ID); + Required.push_back(FindUnsafePointerTypes::ID); + MutateStructTypes::getAnalysisUsageInfo(Required, Destroyed, Provided); +} |