From 1c481f50d2392ba2576c9d574822e77e28f42426 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Tue, 9 Feb 2016 01:21:57 +0000 Subject: Add an "addUsedAAAnalyses" helper function Summary: Passes that call `getAnalysisIfAvailable` also need to call `addUsedIfAvailable` in `getAnalysisUsage` to indicate to the legacy pass manager that it uses `T`. This contract was being violated by passes that used `createLegacyPMAAResults`. This change fixes this by exposing a helper in AliasAnalysis.h, `addUsedAAAnalyses`, that is complementary to createLegacyPMAAResults and does the right thing when called from `getAnalysisUsage`. Reviewers: chandlerc Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D17010 llvm-svn: 260183 --- llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp') diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index 527fdd1..b84620c 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -64,6 +64,7 @@ struct PostOrderFunctionAttrs : public CallGraphSCCPass { AU.setPreservesCFG(); AU.addRequired(); AU.addRequired(); + addUsedAAAnalyses(AU); CallGraphSCCPass::getAnalysisUsage(AU); } -- cgit v1.1