From c85cfdd18db15c422980d2a6c5924ff64e5d9603 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 18 Sep 2013 08:19:56 -0700 Subject: [PATCH] StructurizeCFG: Add dependency on LowerSwitch pass Switch instructions were crashing the StructurizeCFG pass, and it's probably easier anyway if we don't need to handle them in this pass. --- lib/Transforms/Scalar/StructurizeCFG.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/StructurizeCFG.cpp b/lib/Transforms/Scalar/StructurizeCFG.cpp index bb6f163..72fea80 100644 --- a/lib/Transforms/Scalar/StructurizeCFG.cpp +++ b/lib/Transforms/Scalar/StructurizeCFG.cpp @@ -231,7 +231,7 @@ public: StructurizeCFG() : RegionPass(ID) { - initializeRegionInfoPass(*PassRegistry::getPassRegistry()); + initializeStructurizeCFGPass(*PassRegistry::getPassRegistry()); } using Pass::doInitialization; @@ -244,6 +244,7 @@ public: } void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequiredID(LowerSwitchID); AU.addRequired(); AU.addPreserved(); RegionPass::getAnalysisUsage(AU); @@ -256,6 +257,7 @@ char StructurizeCFG::ID = 0; INITIALIZE_PASS_BEGIN(StructurizeCFG, "structurizecfg", "Structurize the CFG", false, false) +INITIALIZE_PASS_DEPENDENCY(LowerSwitch) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_DEPENDENCY(RegionInfo) INITIALIZE_PASS_END(StructurizeCFG, "structurizecfg", "Structurize the CFG", -- 1.8.1.4