mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:06:21 +01:00
[LoopExtractor] Fix legacy pass dependencies
Fixes a memory leak of allocating `LoopInfoWrapperPass` and `DominatorTreeWrapperPass`.
This commit is contained in:
@@ -56,10 +56,10 @@ namespace {
|
||||
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const override {
|
||||
AU.addRequiredID(BreakCriticalEdgesID);
|
||||
AU.addRequiredID(LoopSimplifyID);
|
||||
AU.addRequired<DominatorTreeWrapperPass>();
|
||||
AU.addRequired<LoopInfoWrapperPass>();
|
||||
AU.addPreserved<LoopInfoWrapperPass>();
|
||||
AU.addRequiredID(LoopSimplifyID);
|
||||
AU.addUsedIfAvailable<AssumptionCacheTracker>();
|
||||
}
|
||||
};
|
||||
@@ -69,9 +69,9 @@ char LoopExtractor::ID = 0;
|
||||
INITIALIZE_PASS_BEGIN(LoopExtractor, "loop-extract",
|
||||
"Extract loops into new functions", false, false)
|
||||
INITIALIZE_PASS_DEPENDENCY(BreakCriticalEdges)
|
||||
INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
|
||||
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
|
||||
INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
|
||||
INITIALIZE_PASS_END(LoopExtractor, "loop-extract",
|
||||
"Extract loops into new functions", false, false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user