diff options
author | Duncan Sands <baldrick@free.fr> | 2009-01-28 13:14:17 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-01-28 13:14:17 +0000 |
commit | 1465d61bdd36cfd6021036a527895f0dd358e97d (patch) | |
tree | 5a066582fade4aa68d9608de87fb15a0400fe12a /lib | |
parent | e02f724880ddb7ffe296cda3ffb9822761a13ce7 (diff) | |
download | llvm-1465d61bdd36cfd6021036a527895f0dd358e97d.tar.gz llvm-1465d61bdd36cfd6021036a527895f0dd358e97d.tar.bz2 llvm-1465d61bdd36cfd6021036a527895f0dd358e97d.tar.xz |
Rename getAnalysisToUpdate to getAnalysisIfAvailable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
25 files changed, 56 insertions, 56 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 50cd24ba82..9334f1ef3f 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -141,7 +141,7 @@ void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const { bool AsmPrinter::doInitialization(Module &M) { Mang = new Mangler(M, TAI->getGlobalPrefix(), TAI->getPrivateGlobalPrefix()); - GCModuleInfo *MI = getAnalysisToUpdate<GCModuleInfo>(); + GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>(); assert(MI && "AsmPrinter didn't require GCModuleInfo?"); if (TAI->hasSingleParameterDotFile()) { @@ -163,9 +163,9 @@ bool AsmPrinter::doInitialization(Module &M) { SwitchToDataSection(""); // Reset back to no section. - MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>(); if (MMI) MMI->AnalyzeModule(M); - DW = getAnalysisToUpdate<DwarfWriter>(); + DW = getAnalysisIfAvailable<DwarfWriter>(); return false; } @@ -218,7 +218,7 @@ bool AsmPrinter::doFinalization(Module &M) { } } - GCModuleInfo *MI = getAnalysisToUpdate<GCModuleInfo>(); + GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>(); assert(MI && "AsmPrinter didn't require GCModuleInfo?"); for (GCModuleInfo::iterator I = MI->end(), E = MI->begin(); I != E; ) if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*--I)) diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index 85df7a9d36..fe8ce522f0 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -198,7 +198,7 @@ bool BranchFolder::runOnMachineFunction(MachineFunction &MF) { RS = RegInfo->requiresRegisterScavenging(MF) ? new RegScavenger() : NULL; - MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MMI = getAnalysisIfAvailable<MachineModuleInfo>(); bool MadeChangeThisIteration = true; while (MadeChangeThisIteration) { diff --git a/lib/CodeGen/GCMetadata.cpp b/lib/CodeGen/GCMetadata.cpp index f2978f8888..4742ad8bbb 100644 --- a/lib/CodeGen/GCMetadata.cpp +++ b/lib/CodeGen/GCMetadata.cpp @@ -205,7 +205,7 @@ bool Deleter::runOnFunction(Function &MF) { } bool Deleter::doFinalization(Module &M) { - GCModuleInfo *GMI = getAnalysisToUpdate<GCModuleInfo>(); + GCModuleInfo *GMI = getAnalysisIfAvailable<GCModuleInfo>(); assert(GMI && "Deleter didn't require GCModuleInfo?!"); GMI->clear(); return false; diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp index 517b3a7762..96b81226bd 100644 --- a/lib/CodeGen/GCStrategy.cpp +++ b/lib/CodeGen/GCStrategy.cpp @@ -144,7 +144,7 @@ bool LowerIntrinsics::doInitialization(Module &M) { // work against the entire module. But this cannot be done at // runFunction time (initializeCustomLowering likely needs to change // the module). - GCModuleInfo *MI = getAnalysisToUpdate<GCModuleInfo>(); + GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>(); assert(MI && "LowerIntrinsics didn't require GCModuleInfo!?"); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) if (!I->isDeclaration() && I->hasGC()) diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 724c113b79..1c29c7fed3 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -320,7 +320,7 @@ char DebugLabelFolder::ID = 0; bool DebugLabelFolder::runOnMachineFunction(MachineFunction &MF) { // Get machine module info. - MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>(); if (!MMI) return false; // Track if change is made. diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index bd389db31f..147ccab3a1 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -174,7 +174,7 @@ void PNE::LowerAtomicPHINode(MachineBasicBlock &MBB, } // Update live variable information if there is any. - LiveVariables *LV = getAnalysisToUpdate<LiveVariables>(); + LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>(); if (LV) { MachineInstr *PHICopy = prior(AfterPHIsIt); diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index 4ebf742a4c..39f96133bd 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -56,7 +56,7 @@ namespace { // Get MachineModuleInfo so that we can track the construction of the // frame. - if (MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>()) + if (MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>()) Fn.getFrameInfo()->setMachineModuleInfo(MMI); // Allow the target machine to make some adjustments to the function diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index ca0cd6e8f5..3ae70c850d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -314,8 +314,8 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { DOUT << "\n\n\n=== " << Fn.getName() << "\n"; FuncInfo->set(Fn, *MF, EnableFastISel); - MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>(); - DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>(); + MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>(); + DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>(); CurDAG->init(*MF, MMI, DW); SDL->init(GFI, *AA); diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 5cf2ffd377..794f772101 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -379,7 +379,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) { MRI = &MF.getRegInfo(); TII = TM.getInstrInfo(); TRI = TM.getRegisterInfo(); - LV = getAnalysisToUpdate<LiveVariables>(); + LV = getAnalysisIfAvailable<LiveVariables>(); bool MadeChange = false; diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp index c597e5fd7d..c3b213cebe 100644 --- a/lib/CodeGen/UnreachableBlockElim.cpp +++ b/lib/CodeGen/UnreachableBlockElim.cpp @@ -105,7 +105,7 @@ const PassInfo *const llvm::UnreachableMachineBlockElimID = &Y; bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) { SmallPtrSet<MachineBasicBlock*, 8> Reachable; - MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MMI = getAnalysisIfAvailable<MachineModuleInfo>(); // Mark all reachable blocks. for (df_ext_iterator<MachineFunction*, SmallPtrSet<MachineBasicBlock*, 8> > diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 12e13466d1..83df20cc17 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -782,9 +782,9 @@ bool ARMAsmPrinter::doInitialization(Module &M) { bool Result = AsmPrinter::doInitialization(M); // Emit initial debug information. - MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MMI = getAnalysisIfAvailable<MachineModuleInfo>(); assert(MMI); - DW = getAnalysisToUpdate<DwarfWriter>(); + DW = getAnalysisIfAvailable<DwarfWriter>(); assert(DW && "Dwarf Writer is not available"); DW->BeginModule(&M, MMI, O, this, TAI); diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp index 62da3b7493..e9b3fc2d26 100644 --- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp @@ -491,9 +491,9 @@ bool LinuxAsmPrinter::doInitialization(Module &M) { bool Result = AsmPrinter::doInitialization(M); SwitchToTextSection("\t.text"); // Emit initial debug information. - DW = getAnalysisToUpdate<DwarfWriter>(); + DW = getAnalysisIfAvailable<DwarfWriter>(); assert(DW && "Dwarf Writer is not available"); - MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MMI = getAnalysisIfAvailable<MachineModuleInfo>(); DW->BeginModule(&M, MMI, O, this, TAI); return Result; } diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp index 5fe77be040..5f3ba931fa 100644 --- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp @@ -641,9 +641,9 @@ bool PPCLinuxAsmPrinter::doInitialization(Module &M) { bool Result = AsmPrinter::doInitialization(M); // Emit initial debug information. - MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MMI = getAnalysisIfAvailable<MachineModuleInfo>(); assert(MMI); - DW = getAnalysisToUpdate<DwarfWriter>(); + DW = getAnalysisIfAvailable<DwarfWriter>(); assert(DW && "DwarfWriter is not available"); DW->BeginModule(&M, MMI, O, this, TAI); @@ -859,9 +859,9 @@ bool PPCDarwinAsmPrinter::doInitialization(Module &M) { // Emit initial debug information. // We need this for Personality functions. // AsmPrinter::doInitialization should have done this analysis. - MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MMI = getAnalysisIfAvailable<MachineModuleInfo>(); assert(MMI); - DW = getAnalysisToUpdate<DwarfWriter>(); + DW = getAnalysisIfAvailable<DwarfWriter>(); assert(DW && "DwarfWriter is not available"); DW->BeginModule(&M, MMI, O, this, TAI); diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index e09411a517..9e0afc8d6f 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -737,8 +737,8 @@ bool X86ATTAsmPrinter::doInitialization(Module &M) { // Let PassManager know we need debug information and relay // the MachineModuleInfo address on to DwarfWriter. // AsmPrinter::doInitialization did this analysis. - MMI = getAnalysisToUpdate<MachineModuleInfo>(); - DW = getAnalysisToUpdate<DwarfWriter>(); + MMI = getAnalysisIfAvailable<MachineModuleInfo>(); + DW = getAnalysisIfAvailable<DwarfWriter>(); DW->BeginModule(&M, MMI, O, this, TAI); } @@ -975,7 +975,7 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { } // Emit final debug information. - DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>(); + DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>(); DW->EndModule(); // Funny Darwin hack: This flag tells the linker that no global symbols @@ -995,11 +995,11 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { } // Emit final debug information. - DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>(); + DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>(); DW->EndModule(); } else if (Subtarget->isTargetELF()) { // Emit final debug information. - DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>(); + DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>(); DW->EndModule(); } diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp index f966d8564d..9e6e19fe44 100644 --- a/lib/Target/XCore/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/XCoreAsmPrinter.cpp @@ -441,9 +441,9 @@ bool XCoreAsmPrinter::doInitialization(Module &M) { } // Emit initial debug information. - DW = getAnalysisToUpdate<DwarfWriter>(); + DW = getAnalysisIfAvailable<DwarfWriter>(); assert(DW && "Dwarf Writer is not available"); - DW->BeginModule(&M, getAnalysisToUpdate<MachineModuleInfo>(), + DW->BeginModule(&M, getAnalysisIfAvailable<MachineModuleInfo>(), O, this, TAI); return Result; } diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp index b226d1959a..5093ae90b5 100644 --- a/lib/Transforms/IPO/Internalize.cpp +++ b/lib/Transforms/IPO/Internalize.cpp @@ -99,7 +99,7 @@ void InternalizePass::LoadFile(const char *Filename) { } bool InternalizePass::runOnModule(Module &M) { - CallGraph *CG = getAnalysisToUpdate<CallGraph>(); + CallGraph *CG = getAnalysisIfAvailable<CallGraph>(); CallGraphNode *ExternalNode = CG ? CG->getExternalCallingNode() : 0; if (ExternalNames.empty()) { diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index aed84e2df8..65b74b4e7f 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -457,7 +457,7 @@ void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) { "Expected only one incoming value from Original PreHeader"); } - if (DominatorTree *DT = getAnalysisToUpdate<DominatorTree>()) { + if (DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>()) { DT->addNewBlock(NewPreHeader, OrigPreHeader); DT->changeImmediateDominator(L->getHeader(), NewPreHeader); DT->changeImmediateDominator(Exit, OrigPreHeader); @@ -473,7 +473,7 @@ void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) { DT->changeImmediateDominator(OrigHeader, OrigLatch); } - if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>()) { + if (DominanceFrontier *DF = getAnalysisIfAvailable<DominanceFrontier>()) { // New Preheader's dominance frontier is Exit block. DominanceFrontier::DomSetType NewPHSet; NewPHSet.insert(Exit); @@ -509,7 +509,7 @@ void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) { // If a loop block dominates new loop latch then its frontier is // new header and Exit. BasicBlock *NewLatch = L->getLoopLatch(); - DominatorTree *DT = getAnalysisToUpdate<DominatorTree>(); + DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>(); for (Loop::block_iterator BI = L->block_begin(), BE = L->block_end(); BI != BE; ++BI) { BasicBlock *B = *BI; diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index 6d685d58f9..2025fb6828 100644 --- a/lib/Transforms/Scalar/LoopUnroll.cpp +++ b/lib/Transforms/Scalar/LoopUnroll.cpp @@ -170,10 +170,10 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) { return false; // FIXME: Reconstruct dom info, because it is not preserved properly. - DominatorTree *DT = getAnalysisToUpdate<DominatorTree>(); + DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>(); if (DT) { DT->runOnFunction(*F); - DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>(); + DominanceFrontier *DF = getAnalysisIfAvailable<DominanceFrontier>(); if (DF) DF->runOnFunction(*F); } diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 97aa475a67..a563c7a9ee 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -188,8 +188,8 @@ static Value *FindLIVLoopCondition(Value *Cond, Loop *L, bool &Changed) { bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) { LI = &getAnalysis<LoopInfo>(); LPM = &LPM_Ref; - DF = getAnalysisToUpdate<DominanceFrontier>(); - DT = getAnalysisToUpdate<DominatorTree>(); + DF = getAnalysisIfAvailable<DominanceFrontier>(); + DT = getAnalysisIfAvailable<DominatorTree>(); currentLoop = L; Function *F = currentLoop->getHeader()->getParent(); bool Changed = false; diff --git a/lib/Transforms/Utils/BasicBlockUtils.cpp b/lib/Transforms/Utils/BasicBlockUtils.cpp index 431424ee9f..7b633b2007 100644 --- a/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -136,7 +136,7 @@ bool llvm::MergeBlockIntoPredecessor(BasicBlock* BB, Pass* P) { // Finally, erase the old block and update dominator info. if (P) { - if (DominatorTree* DT = P->getAnalysisToUpdate<DominatorTree>()) { + if (DominatorTree* DT = P->getAnalysisIfAvailable<DominatorTree>()) { DomTreeNode* DTN = DT->getNode(BB); DomTreeNode* PredDTN = DT->getNode(PredBB); @@ -299,11 +299,11 @@ BasicBlock *llvm::SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P) { BasicBlock *New = Old->splitBasicBlock(SplitIt, Old->getName()+".split"); // The new block lives in whichever loop the old one did. - if (LoopInfo* LI = P->getAnalysisToUpdate<LoopInfo>()) + if (LoopInfo* LI = P->getAnalysisIfAvailable<LoopInfo>()) if (Loop *L = LI->getLoopFor(Old)) L->addBasicBlockToLoop(New, LI->getBase()); - if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) + if (DominatorTree *DT = P->getAnalysisIfAvailable<DominatorTree>()) { // Old dominates New. New node domiantes all other nodes dominated by Old. DomTreeNode *OldNode = DT->getNode(Old); @@ -319,7 +319,7 @@ BasicBlock *llvm::SplitBlock(BasicBlock *Old, Instruction *SplitPt, Pass *P) { DT->changeImmediateDominator(*I, NewNode); } - if (DominanceFrontier *DF = P->getAnalysisToUpdate<DominanceFrontier>()) + if (DominanceFrontier *DF = P->getAnalysisIfAvailable<DominanceFrontier>()) DF->splitBlock(Old); return New; @@ -350,12 +350,12 @@ BasicBlock *llvm::SplitBlockPredecessors(BasicBlock *BB, Preds[i]->getTerminator()->replaceUsesOfWith(BB, NewBB); // Update dominator tree and dominator frontier if available. - DominatorTree *DT = P ? P->getAnalysisToUpdate<DominatorTree>() : 0; + DominatorTree *DT = P ? P->getAnalysisIfAvailable<DominatorTree>() : 0; if (DT) DT->splitBlock(NewBB); - if (DominanceFrontier *DF = P ? P->getAnalysisToUpdate<DominanceFrontier>():0) + if (DominanceFrontier *DF = P ? P->getAnalysisIfAvailable<DominanceFrontier>():0) DF->splitBlock(NewBB); - AliasAnalysis *AA = P ? P->getAnalysisToUpdate<AliasAnalysis>() : 0; + AliasAnalysis *AA = P ? P->getAnalysisIfAvailable<AliasAnalysis>() : 0; // Insert a new PHI node into NewBB for every PHI node in BB and that new PHI diff --git a/lib/Transforms/Utils/BreakCriticalEdges.cpp b/lib/Transforms/Utils/BreakCriticalEdges.cpp index a32c016712..c4fd1eae43 100644 --- a/lib/Transforms/Utils/BreakCriticalEdges.cpp +++ b/lib/Transforms/Utils/BreakCriticalEdges.cpp @@ -187,7 +187,7 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, bool NewBBDominatesDestBB = true; // Should we update DominatorTree information? - if (DominatorTree *DT = P->getAnalysisToUpdate<DominatorTree>()) { + if (DominatorTree *DT = P->getAnalysisIfAvailable<DominatorTree>()) { DomTreeNode *TINode = DT->getNode(TIBB); // The new block is not the immediate dominator for any other nodes, but @@ -218,7 +218,7 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, } // Should we update DominanceFrontier information? - if (DominanceFrontier *DF = P->getAnalysisToUpdate<DominanceFrontier>()) { + if (DominanceFrontier *DF = P->getAnalysisIfAvailable<DominanceFrontier>()) { // If NewBBDominatesDestBB hasn't been computed yet, do so with DF. if (!OtherPreds.empty()) { // FIXME: IMPLEMENT THIS! @@ -252,7 +252,7 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P, } // Update LoopInfo if it is around. - if (LoopInfo *LI = P->getAnalysisToUpdate<LoopInfo>()) { + if (LoopInfo *LI = P->getAnalysisIfAvailable<LoopInfo>()) { // If one or the other blocks were not in a loop, the new block is not // either, and thus LI doesn't need to be updated. if (Loop *TIL = LI->getLoopFor(TIBB)) diff --git a/lib/Transforms/Utils/CloneLoop.cpp b/lib/Transforms/Utils/CloneLoop.cpp index d52d79598f..a0306ffa52 100644 --- a/lib/Transforms/Utils/CloneLoop.cpp +++ b/lib/Transforms/Utils/CloneLoop.cpp @@ -79,8 +79,8 @@ Loop *llvm::CloneLoop(Loop *OrigL, LPPassManager *LPM, LoopInfo *LI, DominatorTree *DT = NULL; DominanceFrontier *DF = NULL; if (P) { - DT = P->getAnalysisToUpdate<DominatorTree>(); - DF = P->getAnalysisToUpdate<DominanceFrontier>(); + DT = P->getAnalysisIfAvailable<DominatorTree>(); + DF = P->getAnalysisIfAvailable<DominanceFrontier>(); } SmallVector<BasicBlock *, 16> NewBlocks; diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index af41036252..03d273d25d 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -112,7 +112,7 @@ FunctionPass *llvm::createLoopSimplifyPass() { return new LoopSimplify(); } bool LoopSimplify::runOnFunction(Function &F) { bool Changed = false; LI = &getAnalysis<LoopInfo>(); - AA = getAnalysisToUpdate<AliasAnalysis>(); + AA = getAnalysisIfAvailable<AliasAnalysis>(); DT = &getAnalysis<DominatorTree>(); // Check to see that no blocks (other than the header) in loops have @@ -595,6 +595,6 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) { // Update dominator information DT->splitBlock(BEBlock); - if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>()) + if (DominanceFrontier *DF = getAnalysisIfAvailable<DominanceFrontier>()) DF->splitBlock(BEBlock); } diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 35cbe906b7..6db5d7e24c 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -37,7 +37,7 @@ Pass::~Pass() { ModulePass::~ModulePass() { } bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const { - return Resolver->getAnalysisToUpdate(AnalysisID, true) != 0; + return Resolver->getAnalysisIfAvailable(AnalysisID, true) != 0; } // dumpPassStructure - Implement the -debug-passes=Structure option diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index 690c485fe2..f2bfaefe0f 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -679,7 +679,7 @@ void PMDataManager::verifyDomInfo(Pass &P, Function &F) { if (!VerifyDomInfo || !P.getResolver()) return; - DominatorTree *DT = P.getAnalysisToUpdate<DominatorTree>(); + DominatorTree *DT = P.getAnalysisIfAvailable<DominatorTree>(); if (!DT) return; @@ -695,7 +695,7 @@ void PMDataManager::verifyDomInfo(Pass &P, Function &F) { assert (0 && "Invalid dominator info"); } - DominanceFrontier *DF = P.getAnalysisToUpdate<DominanceFrontier>(); + DominanceFrontier *DF = P.getAnalysisIfAvailable<DominanceFrontier>(); if (!DF) return; @@ -1088,8 +1088,8 @@ PMDataManager::~PMDataManager() { //===----------------------------------------------------------------------===// // NOTE: Is this the right place to define this method ? -// getAnalysisToUpdate - Return an analysis result or null if it doesn't exist -Pass *AnalysisResolver::getAnalysisToUpdate(AnalysisID ID, bool dir) const { +// getAnalysisIfAvailable - Return analysis result or null if it doesn't exist. +Pass *AnalysisResolver::getAnalysisIfAvailable(AnalysisID ID, bool dir) const { return PM.findAnalysisPass(ID, dir); } |